Explore Related Tools
Hand-picked utilities and calculators related to this tool.
While Express comes with minimal built-in middleware, the ecosystem provides a vast array of tools to add common functionality.
Morgan is used to log incoming requests to your terminal for debugging and monitoring.
const morgan = require('morgan');
app.use(morgan('dev'));Essential when your frontend (e.g., React on port 3000) tries to talk to your backend (Express on port 5000).
const cors = require('cors');
app.use(cors());Parses Cookie headers and populates req.cookies with an object keyed by the cookie names.
const cookieParser = require('cookie-parser');
app.use(cookieParser());
// Accessing a cookie
app.get('/', (req, res) => {
console.log('Cookies:', req.cookies);
});Gzip compression can significantly decrease the size of the response body and hence increase the speed of a web app.
const compression = require('compression');
app.use(compression());cors() and morgan()at the very top of your app.js middleware stack.Hand-picked utilities and calculators related to this tool.
