在快遞的NodeJS模塊,指定的路徑 「/」 將趕上等 「/」, 「LIB/main.js」, 「圖像/ icon.gif」 等快車的NodeJS根路徑
var app = require('express')
app.use('/', authenticate);
多個HTTP請求
在上面的例子中,如果作爲authenticate
隨後
var authenticate = function(request, response, next) {
console.log("=> path = " + request.path);
next()
}
然後定義你會看到
=> path =/
=> path = /lib/main.js
=> path = /images/icon.gif
誰能告訴我如何defin快遞「app.use」中只有「/」的e路徑?
'app.get('/')'? – hassansin