0
A
回答
0
見https://expressjs.com/en/guide/routing.html
查詢字符串不是的一部分路線路徑。
如果你想使用的查詢字符串,使用req.query
:
app.get('/search', function (req, res) {
console.log(req.query);
});
0
你想要什麼或者是路由參數:
app.get('/foo/:bar', (req, res) => { //GET /foo/helloworld
console.log(req.params.bar); //helloworld
//...
});
或GET參數:
app.get('/foo', (req, res) => { //GET /foo?bar=helloworld
console.log(req.query.bar); //helloworld
//...
});
你現在正在做的是m讓他們興奮起來,這不起作用。
相關問題
- 1. Spree API中的Taxon查詢
- 2. Java中的查詢mongodb API
- 3. 查詢flickr api
- 4. 查詢graph.facebook.com API
- 5. 在Go中查詢Magento API
- 6. web api:檢查odata查詢
- 7. SL ReloadOS API查詢
- 8. WCM REST API查詢
- 9. QuickBooks API - 查詢SalesItemLineDetail
- 10. Google Maps API查詢
- 11. API創建查詢
- 12. Google Places API查詢
- 13. 缺少API查詢?
- 14. Fusion Table API查詢
- 15. nhibernate查詢條件api linq查詢
- 16. Django查詢api:複雜子查詢
- 17. 查詢阻塞CORS的API
- 18. FQL Facebook的API查詢
- 19. Elasticsearch的Java API查詢
- 20. WEB API 2的IQueryable查詢
- 21. 安全的MySQL查詢API
- 22. 單個API中的多個查詢
- 23. Elasticsearch Java API中的範圍查詢
- 24. JPA Criteria API查詢中的字符串
- 25. 子查詢中休眠的標準API
- 26. 查詢SharePoint ClientObjectModel中的文件API
- 27. 使用Google Fusion Tables中的查詢API
- 28. Mysql查詢中的Google API請求?
- 29. 查詢具有更復雜搜索查詢的訂單的API?
- 30. VSTS Rest API對Powershell中鏈接工作項的API查詢
'?'後面的文本可能不被路由器視爲URL的一部分。 – wroniasty