Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@adastradev/serverless-discovery-sdk

Package Overview
Dependencies
Maintainers
22
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adastradev/serverless-discovery-sdk

Serverless Service Discovery API

  • 2.0.0-beta.2
  • npm
  • Socket score

Version published
Weekly downloads
1.4K
decreased by-1.02%
Maintainers
22
Weekly downloads
 
Created
Source

serverless-discovery-sdk-js

npm license The last serverless micro-service you'll ever wonder how to find

The AWS Serverless Discovery SDK interacts with a discovery microservice to discover endpoints for micro-services written for a serverless architecture. This is similar to clustered services such as Consul or ZooKeeper, but without the concept of instances or nodes that must be monitored for online state. This library is designed to support use both on the server side (for service-to-service lookups) and on the browser/client side.

This project contains the Typescript/Javascript bindings for the discovery service; Other bindings can be found in the AdAstraDev organization on GitHub

Installation

npm install @adastradev/serverless-discovery-sdk

Usage

Environmental

Configured Dependencies

Semver versioning is supported by the discovery service 1.1.x. Pass a semver compatible value in the lookupService call to receive the newest compatible matching version. Services and their desired versions can also be specified in your package.json file. Enter the values in a cloudDependencies section, and populate it in the same format as the standard dependencies section. When using the cloudDependencies method, only the service name needs to be provided in the lookupService call.

{
  "cloudDependencies": {
    "service1": "1.x.x",
    "service2": "^1.2.8"
  }
}
Version Postfix values

In some testing environments, it can be useful to modify the lookup version to avoid collision with a production environment. For example, the service "foo" with version "1.0.0" can instead query version "1.0.0-staging". To enable this feature at runtime, set the environment variable VERSION_POSTFIX to the desired value. In this case it would be set to -staging. This can especially be useful when using cloudDependencies to select service versions.

Javascript

var DiscoverySdk = require('@adastradev/serverless-discovery-sdk').DiscoverySdk;
var sdk = new DiscoverySdk('https://abcdefghij.execute-api.us-east-1.amazonaws.com/prod', 'us-east-1');

var endpoints = await sdk.lookupService('my-service-name', undefined, '1.x.x');

TypeScript

import { DiscoverySdk } from '@adastradev/serverless-discovery-sdk';
const sdk: DiscoverySdk = new DiscoverySdk('https://abcdefghij.execute-api.us-east-1.amazonaws.com/prod', 'us-east-1');

const endpoints = await sdk.lookupService('my-service-name', undefined, '1.x.x');

Keywords

FAQs

Package last updated on 30 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc