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. 在Go中查詢Magento API
- 3. web api:檢查odata查詢
- 4. Django查詢api:複雜子查詢
- 5. Fusion Table API查詢
- 6. QuickBooks API - 查詢SalesItemLineDetail
- 7. 缺少API查詢?
- 8. 查詢阻塞CORS的API
- 9. Elasticsearch的Java API查詢
- 10. 單個API中的多個查詢
- 11. 使用Google Fusion Tables中的查詢API
- 12. 子查詢中休眠的標準API
- 13. 查詢SharePoint ClientObjectModel中的文件API
- 14. VSTS Rest API對Powershell中鏈接工作項的API查詢
- 15. 在Saxon api中插入查詢
- 16. 如何在web api中緩存查詢?
- 17. 報價查詢在eTrade api中失敗
- 18. 在Google中查詢時未使用API
- 19. 在javascript中獲取twitter-api url查詢
- 20. 如何在Android中查詢api?
- 21. 在rails中查詢多條記錄API
- 22. 不能與Parse.com API查詢
- 23. Google可視化API查詢
- 24. 查詢Web服務API
- 25. 密碼散列API查詢
- 26. SOQL查詢與Socrata API
- 27. TFS API C#查詢語法
- 28. Expressjs:搜索查詢api
- 29. 股票代碼查詢API
- 30. 使用node.js查詢JSON API
'?'後面的文本可能不被路由器視爲URL的一部分。 – wroniasty