简体   繁体   中英

How can I show node.js queries in terminal?

I have made a demo app to do basic database operations. I am using mongoose and express modules. In the tutorial where I started to learn node in the terminal the following line ( PUT /flight/33/arrived 200 17ms - 22b ) I could see. What I am missing from my code?

在此处输入图片说明

UPDATE

Thanks Esteban! This what I have done: terminal > npm install morgan

code:

var morgan = require('morgan');
app.use(morgan('dev'));

You need to use the logging middleware. It's morgan for express 4. You can check out an example of how it's set up in the docs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM