我正在使用"connect": "^3.3.5"
,我有app.use '/', messageMiddleware.incoming, userMiddleware.process
我的messageMiddleware
有:
exports.incoming = (req, res, next) ->
fromNumber = req.body.From
toNumber = req.body.To
global.db.Message.create
message: req.body.Body.trim()
from: fromNumber
to: toNumber
.then (dbMessage) ->
req.MessageId = dbMessage.id
next()
.catch (err) ->
next err
我的userMiddleware
有
'use strict'
exports.process = (req, res, next) ->
console.log 'processing'
res.end()
但是,它不会记录processing
或end
. 我做错了什么?