Answers for "node js get url from request"

4

express get full url

var fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl;
Posted by: Guest on June-10-2020
0

express get raw path

const url = require('url');
const express = require('express');

const app = express();
app.use((req, res, next) => {
  const path = url.parse(req.url).path;
  // Do something...
});

const port = 3000;
app.listen(port, console.log(`Listening on port ${port}.`));
Posted by: Guest on August-27-2020
0

node js get url from request

var fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl;
Posted by: Guest on April-27-2021

Code answers related to "node js get url from request"

Code answers related to "Javascript"

Browse Popular Code Answers by Language