[Tests] addServerMiddleware with string path

This commit is contained in:
Pooya Parsa 2017-05-21 20:15:43 +04:30
parent 08fd004044
commit 04d3a22212
2 changed files with 7 additions and 0 deletions

View File

@ -8,6 +8,8 @@ module.exports = function middlewareModule (options) {
res.end('It works!')
}
})
// Add local middleware js
this.addServerMiddleware('~/modules/middleware/log.js')
// Add plain middleware
this.addServerMiddleware((req, res, next) => {
next()

View File

@ -0,0 +1,5 @@
module.exports = function (req, res, next) {
// eslint-disable-next-line no-console
console.log(req.url)
next()
}