2016-11-15 69 views

回答

0

至於我記得,並能與虛擬應用測試 -

app.use('/helloword', hellowordRoute); 

將成爲雙方http://www.somehost.com/hellowordhttp://www.somehost.com/helloword/

請提供更多的細節......

0

默認用相同的路線表示處理有和沒有斜線的路線。這意味着表示忽略尾部斜線,並且像尾部斜線一樣對待路線,而不使用尾部斜線。但是,如果將「嚴格路由」魔女由默認值是「假」到「真」這樣的

app.set('strict routing', true); 

他們將區別對待

,你可以有不同的處理程序是這樣

app.get("/helloword", function(req, res){ 
    console.log("helloword"); 
}); 
app.get("/helloword/", function(req, res){ 
    console.log("helloword/"); 
}); 
相關問題