Closed clarktlaugh closed 5 years ago
Hi @clarktlaugh thanks for reaching out. Although I would highly recommend to run your API gateway isolated from your services logic, here I describe the way you can get your solution working:
const app = express()
app.get('/route1', function(req, res) {
...
})
app.get('/route2', function(req, res) {
...
})
gateway({
restana: {
defaultRoute: (req, res) => app.handle(req, res)
},
...
This will route to the express application all the un-matched requests on the gateway.
Thanks and Regards.
Thank you. My intent was to add an admin API to my gateway service. But, I should consider how to do it as a separate service.
I have some other routes (in express) and I want to also use fast-gateway . Is this possible? I saw where I can pass in options to fast-gateway for restana (
opts.restana
) and provide it a pre-existing server instance to use.I'm doing something like this:
My express routes are working. The ones defined in fast-gateway are not.