您好,我的app.js中有代码,如下所示:
app.use('/someurl', require('./middleware/somemodule'));
-app.use 代替 app.all
和模块看起来像:
if(process.env.BLALAL === undefined){
throw "Error: process.env.BLALAL === undefined";
}
module.exports = function(req, res, next){
...
}
这是不好的做法吗?