Last active
December 2, 2019 17:46
-
-
Save jkyberneees/561d81120e83b404ff8ed77490e79d6d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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!`) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@gvalmana revisa si tu localhost no requieres algun puerto, o intenta poner localhost:80/micro....