Node.js : Express app.get with multiple query parameters

前端 未结 3 1443
渐次进展
渐次进展 2021-02-06 03:28

I want to query the yelp api, and have the following route:

app.get(\"/yelp/term/:term/location/:location\", yelp.listPlaces)

When I make a GET

3条回答
  •  没有蜡笔的小新
    2021-02-06 04:07

    Have you tried calling it like this?

    http://localhost:30000/yelp/term/food/location/austin
    

    The URL you need to call usually looks pretty much like the route, you could also change it to:

    /yelp/:location/:term
    

    To make it a little prettier:

    http://localhost:30000/yelp/austin/food
    

提交回复
热议问题