我知道如何為這樣的查詢(xún)獲取參數(shù):app.get('/sample/:id', routes.sample);在這種情況下,我可以使用req.params.id獲取參數(shù)(例如2中的/sample/2)。但是,對(duì)于url like /sample/2?color=red,如何訪(fǎng)問(wèn)變量color?我試過(guò)了,req.params.color但是沒(méi)有用。
如何在Express中的“?”之后訪(fǎng)問(wèn)GET參數(shù)?
翻翻過(guò)去那場(chǎng)雪
2019-12-10 13:08:36