Skip to content

Instantly share code, notes, and snippets.

@jkyberneees
Last active December 2, 2019 17:46
Show Gist options
  • Save jkyberneees/561d81120e83b404ff8ed77490e79d6d to your computer and use it in GitHub Desktop.
Save jkyberneees/561d81120e83b404ff8ed77490e79d6d to your computer and use it in GitHub Desktop.
const gateway = require('fast-gateway')
const PORT = process.env.PORT || 8080
gateway({
middlewares: [
require('cors')(),
require('helmet')()
],
routes: [{
prefix: '/public',
target: 'http://public.myapp:300'
}, {
prefix: '/admin',
target: 'http://admin.myapp:3000',
middlewares: [
require('express-jwt')({
secret: 'shhhhhhared-secret'
})
]
}]
}).start(PORT).then(server => {
console.log(`API Gateway listening on ${PORT} port!`)
})
@mikevb3
Copy link

mikevb3 commented Dec 2, 2019

@gvalmana revisa si tu localhost no requieres algun puerto, o intenta poner localhost:80/micro....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment