BackendStack21/fast-gateway

multiple routes in a target

Closed this issue · 2 comments

dattp commented

I want to declare multiple routes in an element in the routes array

I had routes (without prefix) running on a service: / getUser, / getProflieUser, / getFriend, /updateUser. How can I declare those routes with a target? I want it to be an element in routes. Eg:
routes: [{
   path: ['/ getUser', '/ getProflieUser', '/ getFriend', '/updateUser'],
   target: 'http://localhost:8083',
  }]

Hope you can help me!

{ prefix: '/mock-will-be-removed', target: 'http://localhost:8083' }

THEN

any request sent to:
http://fast-gateway-server/mock-will-be-removed/alpha/beta/foo
are forwarded to
http://localhost:8083/alpha/beta/foo

the prefix is overWritten with blank in the proxy.

however, if you need a specific prefix you can also specify it

{ prefix: '/public', target: 'http://localhost:3000', prefixRewrite: '/api' }

THEN

the request will be forwarded to
http://localhost:8083/api/alpha/beta/foo

I'm not sure if i got your question correctly but if I did, this will answer it

Closing for inactivity.