NodeJs将每个GET请求(.js文件,.css文件等)打印到控制台。
...
GET /plugins/jquery.parallax-1.1.3.js 304 0.652 ms - -
GET /plugins/jquery.validate.js 304 0.434 ms - -
GET /plugins/vide/jquery.vide.js 304 0.910 ms - -
GET /plugins/owl-carousel/owl.carousel.js 304 0.700 ms - -
...
有没有办法停止Node将这些内容打印到控制台?
这是我的
package.json
:{
"name": "ExPlatform",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"bcrypt-nodejs": "0.0.3",
"body-parser": "~1.12.0",
"connect-flash": "^0.1.1",
"cookie-parser": "~1.3.4",
"debug": "~2.1.1",
"ejs": "~2.3.1",
"express": "~4.12.2",
"express-session": "^1.13.0",
"fs": "0.0.2",
"gm": "^1.21.1",
"imagemagick": "^0.1.3",
"mongoose": "^4.3.7",
"mongoose-crate": "^1.0.10",
"mongoose-crate-localfs": "^1.1.1",
"morgan": "~1.5.1",
"multer": "^1.1.0",
"passport": "^0.3.2",
"passport-local": "^1.0.0",
"serve-favicon": "~2.2.0",
"jsonfile": "^2.3.0",
"nodemailer": "^2.4.2",
"fast-csv": "^2.0.0",
"fluent-logger": "^1.1.1"
}
}
谢谢。
最佳答案
发现执行此操作的是morgan
模块。
我有app.user(logger('dev'))
;
关于node.js - 如何停止NodeJS将GET请求打印到控制台,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38038938/