LogoLogo
CS CONSOLECOMMUNITYDOCS
  • What is code.store?
  • Our vision
  • How it works?
  • Getting started
    • Quick Start
      • Core concepts
      • Quick Start with CLI
      • Quick Start with Web Interface
    • FUNDAMENTALS
      • Services
        • GraphQL
        • REST
        • Configuration
        • Environment Variables
      • Environments
      • Projects
      • Versioning
      • Access and Authorization
      • Secret management
      • Data management
        • Import and Export
      • Generation
        • Models
        • Handlers
        • Resolvers
        • REST
        • Middlewares
      • Logging
      • Microservices
        • Communication
    • RECIPES
      • TypeScript
        • Custom .tslint
      • Basic authentication
      • Setup a local database with your service
      • GraphQL
    • Tutorials
      • Auth0 authentication
      • Metabase integration
      • Database manipulations
        • External database: MongoDB
        • External database: DynamoDB
      • Wrapping an NPM package with GraphQL: a chess server
    • FAQ
  • Command Line Interface
    • Getting started
    • Commands
Powered by GitBook
On this page
  • Overview
  • Routing concept
  • HTTP request example

Was this helpful?

Export as PDF
  1. Getting started
  2. FUNDAMENTALS
  3. Microservices

Communication

PreviousMicroservicesNextRECIPES

Last updated 4 years ago

Was this helpful?

Overview

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

We are working hard on the platform functionality and soon we will provide an opportunity to organize inter-service communication through message-brokers.

Routing concept

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:

http://example-service

HTTP request example

To provide an HTTP call to service install any HTTP client, for example using npm:

npm i axios

Import dependency in your code:

import axios from 'axios';

And execute request yo your service. In example below you can find simple HTTP request to [GET] /rest/hello route of example service:

const result = await axios.get('http://service-example/rest/hello');

The result of HTTP request execution will be available in the result object.

axios
axios
environment
environment
environment