0.0.10 • Published 6 years ago

@qmatic/service-discovery v0.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

Description

This package will look up service URLs in AWS CloudMap. It will by default use the "services" namespace, but can use other namespaces as well. Returns a list of strings that are the combination of the AWS_INSTANCE_IPV4 and AWS_INSTANCE_PORT attributes registered in CloudMap. The formation is "http://<AWS_INSTANCE_IPV4>:<AWS_INSTANCE_PORT>", e.g. "http://127.0.0.1:8080"

Installation

npm install @qmatic/service-discovery

Example typescript usage using default namespace

import {ServiceDiscovery, ServiceDiscoveryFactory} from "@qmatic/service-discovery";

let serviceDiscoveryFactory: ServiceDiscoveryFactory = new ServiceDiscovery()

serviceDiscoveryFactory.getUrls("myservicename").then((urls: Array<string>) => {
    urls.forEach((url: string) => {
        console.log("URL: " + url)
    })
})

Example typescript usage using custom namespace

import {ServiceDiscovery, ServiceDiscoveryFactory} from "@qmatic/service-discovery";

let serviceDiscoveryFactory: ServiceDiscoveryFactory = new ServiceDiscovery()

serviceDiscoveryFactory.getUrls("myservicename", "mycustomnamespace").then((urls: Array<string>) => {
    urls.forEach((url: string) => {
        console.log("URL: " + url)
    })
})
0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago