Skip to content

Instantly share code, notes, and snippets.

@rafaelaugustos
Last active September 3, 2020 17:09
Show Gist options
  • Save rafaelaugustos/6fd828c1864b60951ce7cc55d55293c7 to your computer and use it in GitHub Desktop.
Save rafaelaugustos/6fd828c1864b60951ce7cc55d55293c7 to your computer and use it in GitHub Desktop.
import http from 'http'
import express from 'express'
import proxy from 'express-http-proxy'
const app = express()
const account = httpProxy('http://localhost:3001')
const cart = httpProxy('http://localhost:3002')
app.get('/cart', (req, res, next) => {
cart(req, res, next)
})
app.get('/account', (req, res, next) => {
account(req, res, next)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment