Created
September 7, 2018 15:02
-
-
Save dariye/cf1c8ed2128df588d15be6574bd58cf6 to your computer and use it in GitHub Desktop.
micro-proxy.js programmatic usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createProxy = require('micro-proxy') | |
const services = require('./services') | |
const {port} = require('./config').server | |
const server = createProxy(Object.values(services) | |
.map(service => service[process.env.NODE_ENV])) | |
server.listen(port, (err) => { | |
if (err) throw err | |
console.log(`> Ready on http://localhost:${port}`) | |
}) | |
module.exports = server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment