Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 883 Bytes

File metadata and controls

34 lines (27 loc) · 883 Bytes

#ReverseProxy alt text Inspired by: https://memz.co/api-gateway-microservices-docker-node-js/

Description

Standalone Reverse Proxy Server with support for multiple routes using http-proxy. Define routes from multiple services in a configuration file and access them from a single endpoint.

Installation & Usage

#Install Node Modules from package.json
npm i

#Start Server
npm start or pm2 start ReverseProxy

Configuration

Define routes in a config.js file using the following format:

module.exports = routes = {
    'user': {
        apiRoute: '/api/user',
        upstreamUrl: '127.0.0.1:3000'
    },
    'books': {
        apiRoute: '/api/books',
        upstreamUrl: '127.0.0.1:3001'
    }
}

Class: ReverseProxyServer