express-gateway-service-registry
TypeScript icon, indicating that this package has built-in type declarations

2.5.0 • Public • Published

express-gateway-service-registry

Installation

Install GatewayServiceRegistryComponent using npm;

$ [npm install | yarn add] express-gateway-service-registry

Basic Use

Configure and load GatewayServiceRegistryComponent in the application constructor as shown below.

import {GatewayServiceRegistryComponent, Config,GatewayServiceRegistryComponentOptions, DEFAULT_SERVICE_REGISTRY_OPTIONS} from 'express-gateway-service-registry';
// ...
export class MyApplication extends BootMixin(ServiceMixin(RepositoryMixin(RestApplication))) {
  constructor(options: ApplicationConfig = {}) {
    const opts: GatewayServiceRegistryComponentOptions = DEFAULT_SERVICE_REGISTRY_OPTIONS;
    this.configure(GatewayServiceRegistryComponentBindings.COMPONENT).to(opts);
      // Put the configuration options here
    });

    this.bind<Config>(GatewayServiceRegistryComponentBindings.CONFIG).to({

      name: "test-micro",
      path: "/test-micro/*",
      host: "srv.mydomain.com",
      backend: {
        url: "http://localhost:3001"
      }

    });
    this.component(GatewayServiceRegistryComponent);
    // ...
  }
  // ...
}

Package Sidebar

Install

npm i express-gateway-service-registry

Weekly Downloads

64

Version

2.5.0

License

MIT

Unpacked Size

21.4 kB

Total Files

26

Last publish

Collaborators

  • ttsgeek