【发布时间】:2016-06-24 07:55:28
【问题描述】:
所以这会记录到我的控制台: app.use(function (req, res, next) { console.log(req.method) console.log('为什么不工作?') })
但这不是:
app.post(function (req, res, next) {
console.log(req.method)
console.log('why not working?')
})
两者都证明 HTTP 方法是一个 POST
我错过了什么?
【问题讨论】:
-
你怎么称呼它?显示代码。
-
而且,如果这应该是中间件,您还需要调用
next()或发送响应。
标签: javascript node.js express