Kong Route not accessible

I have a node app and I am trying to implement kong API gateway on it. I successfully create a service and a route for my app end point. but whenever I trying to access the route through kong it always through 404 error I don’t know what’s wrong with my code.
the end point of my app is => (/api/v1/customers)
kong service =>
curl -i -X POST
–url http://localhost:7001/services/
–data ‘name=api-v1-customers’
–data ‘url=http://nodeapp:10000’

kong route =>
curl -i -X POST http://localhost:7001/services/api-v1-customers/routes
–data ‘paths[]=/api/v1/customers’
–data ‘name=customers-list’
–data ‘strip_path=true’
–data ‘preserve_host=true’
–data ‘hosts[]=nodeapp’ \

url I 'm trying to hit http://localhost:7001/api/v1/customers

url I 'm trying to hit http://localhost:7001/api/v1/customers

Wrong port 7001 for Kong admin, try proxy port I think 7000

you are right but I tried with 7001 as well. it still throwing an error.


“message”: “no Route matched with those values”

Take a look this config

kong route =>
curl -i -X POST http://localhost:7001/services/api-v1-customers/routes
–data ‘paths[]=/api/v1/customers’
–data ‘name=customers-list’
–data ‘strip_path=true’
–data ‘preserve_host=true’
–data ‘hosts[]=nodeapp’ \

If we config route with –data ‘hosts[]=nodeapp’ it means you need to call API with host header or via domain name

Now try this one

curl -H 'Host: nodeapp' http://127.0.0.1:7000/api/v1/customers

© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ