Skip to content

Instantly share code, notes, and snippets.

const express = require('express')
const app = express()
const port = 3001
app.get('/play', (req, res) => {
res.send('Service B')
})
app.listen(port, () => {
console.log(`Service B is listening at http://localhost:${port}`)
const express = require('express')
const app = express()
const request = require('request')
const port = 3000
app.get('/result', (req, res) => {
var response = 'Service A '
request('http://localhost:3001/play', { json: true }, (err, res, body) => {
response = response + body
version: '3'
services:
servicea-api:
# Using a Dockerfile is optional, but included for completeness.
build:
context: serviceA/
dockerfile: Dockerfile
# [Optional] You can use build args to set options. e.g. 'VARIANT' below affects the image in the Dockerfile
{
"version": "0.2.0",
"configurations": [
{
"name": "ServiceA API",
"port": 5000,
"request": "attach",
"type": "node",
"restart": true,
"remoteRoot": "/app",