My microservice is running in port 3000
and I am trying to proxy the request via express-js gateway
But I got a problem with accessing routes in microservice
MICRO SERVICE ROUTE
app.use('/sample',(req,res)=>{
res.json({
message:'Run with microservice'
})
})
And I am able to access this route http://localhost:3000/sample
.
Here is my gateway.config.yml
.
http:
port: 3004
admin:
port: 9876
hostname: localhost
apiEndpoints:
test:
host: localhost
paths: '/test'
serviceEndpoints:
test:
url: 'http://localhost:3002/'
policies:
- basic-auth
- cors
- expression
- key-auth
- log
- oauth2
- proxy
- rate-limit
pipelines:
test:
apiEndpoints:
- test
policies:
- proxy:
- action:
serviceEndpoint: test
changeOrigin: true
When I try to access my microservice route via http://localhost:3004/test/sample
returns cannot get route error
.