Using External Middleware

Express can use various middleware for functionalities like authentication, logging, etc. For example, to use the morgan logging library:

npm install morgan

Then, in app.js:

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

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *