Communication
Last updated
Was this helpful?
Last updated
Was this helpful?
When you include services to you project there might be a cases, when services should communicate with each other. code.store platform allows inter-HTTP communication
Services, which project includes and deployed in one can communicate with each other.
To call GraphQL or REST API of another service on the same - make an HTTP request, where URL should build by next pattern: http://{SERVICE_NAME}-service
Each service has an internal URL which available only per environment.
Let's imagine that we have service "example", which deployed to the development environment. This service can be accessed by another service on the development by next URL:
To provide an HTTP call to service install any HTTP client, for example using npm:
Import dependency in your code:
And execute request yo your service. In example below you can find simple HTTP request to [GET] /rest/hello
route of example
service:
The result of HTTP request execution will be available in the result object.