jkyberneees / fastify-gateway

A Node.js API gateway that just works!
https://www.npmjs.com/package/k-fastify-gateway
MIT License
107 stars 14 forks source link

Trailing slash problem #23

Closed parthibd closed 5 years ago

parthibd commented 5 years ago

When the trailing slash is present in my url , it works fine . The moment its gone ,404 . Possible bug ?

jkyberneees commented 5 years ago

In case you want to route endpoints instead of fully proxy to remote APIs, you can define your route as described:

{
      pathRegex: '',
      prefix: '/endpoint-proxy',
      prefixRewrite: '/endpoint-proxy',
      target: 'http://localhost:3000',
      middlewares: [],
      hooks: {
      }
}

See how pathRegex is disabled here.

Regards.

parthibd commented 5 years ago

Thanks for the heads up. I was thinking if I should make a pull request adding a global routeRegex that will be overridden if a route defines its own routeRegex?

jkyberneees commented 5 years ago

Hi @parthibd, global pathRegex is allowed from v2.3.0. I will close this issue accordingly.

Thanks.