1const url = require('url');
2const express = require('express');
3
4const app = express();
5app.use((req, res, next) => {
6 const path = url.parse(req.url).path;
7 // Do something...
8});
9
10const port = 3000;
11app.listen(port, console.log(`Listening on port ${port}.`));