express get raw query

Solutions on MaxInterview for express get raw query by the best coders in the world

showing results for - "express get raw query"
Pietro
14 Feb 2016
1const url = require('url');
2const express = require('express');
3
4const app = express();
5app.use((req, res, next) => {
6  const query = url.parse(req.url).query;
7  // Do something...
8});
9
10const port = 3000;
11app.listen(port, console.log(`Listening on port ${port}.`));