@grest-ts/discovery-static
v0.0.20
Published
Static service discovery implementation for Grest Framework
Maintainers
Readme
Part of the grest-ts framework. Documentation | All packages
@grest-ts/discovery-static
Static service discovery for deployments with known, fixed URLs (AWS Elastic Beanstalk, Heroku, Railway, Fly.io, etc.). No dynamic registration or discovery infrastructure needed.
For a full overview of how discovery works, see the Discovery guide.
Usage
From environment variables
USER_API_URL=https://user-service.elasticbeanstalk.com/api/users/
ORDER_API_URL=https://order-service.us-east-1.elasticbeanstalk.com/api/orders/const discovery = new GGStaticServiceDiscovery();
// Reads *_API_URL env vars automatically
// USER_API_URL -> UserApi
// ORDER_API_URL -> OrderApiFrom a config object
const discovery = new GGStaticServiceDiscovery({
UserApi: 'https://user-service.elasticbeanstalk.com/api/users/',
OrderApi: 'https://order-service.elasticbeanstalk.com/api/orders/'
});registerRoutes() is a no-op since URLs are pre-configured.
