UNPKG

express-gateway

Version:

A microservices API gateway built on top of ExpressJS

14 lines (11 loc) 325 B
const url = require('url'); module.exports = class StaticProxy { constructor (proxyOptions, endpoints) { this.proxyOptions = proxyOptions; this.endpoints = endpoints; this.target = url.parse(this.endpoints[0]); } nextTarget () { return Object.assign({}, this.proxyOptions.target, this.target); } };