BackendStack21 / fast-gateway

Fast-gateway is an easy to use Node.js API gateway framework built to handle large scale API traffic with great performance and scalability. Written with JavaScript, it is a framework for the masses!
MIT License
311 stars 35 forks source link

Swagger files are not accessible under gateway #62

Open mopcweb opened 3 years ago

mopcweb commented 3 years ago

Hi! thanks for this lib!!

i have a problem with serving swagger UI under routes specified in fast-gateway.

steps to repoduce

gateway({
    prefix: '/test',
    target: `http://localhost:3022`,
    docs: {
      name: 'Docs',
      endpoint: '/api-docs/swagger.json',
      type: 'swagger',
    },
 }).start(3020);

and basic example server from here.

so when open browser at localhost:3022/api-docs - i'll see Swagger UI. but when open localhost:3020/test/api-docs - there are several errors:

image

Question - how can i serve swagger ui for projects under this gateway?

thanks