Skip to main content
added 29 characters in body
Source Link
double-beep
  • 5.4k
  • 19
  • 37
  • 45
console.log(`${req.protocol}://${req.get('host')}/${req.originalUrl}`);

req.protocol - gives the protocol you used like HTTP

req.get(host) - give host name with port no like localhost:8080

  • req.protocol - gives the protocol you used (e.g. HTTP)
  • req.get(host) - gives the host name with the port number (e.g. localhost:8080)
console.log(`${req.protocol}://${req.get('host')}/${req.originalUrl}`);

req.protocol - gives the protocol you used like HTTP

req.get(host) - give host name with port no like localhost:8080

console.log(`${req.protocol}://${req.get('host')}/${req.originalUrl}`);
  • req.protocol - gives the protocol you used (e.g. HTTP)
  • req.get(host) - gives the host name with the port number (e.g. localhost:8080)
Source Link

console.log(`${req.protocol}://${req.get('host')}/${req.originalUrl}`);

req.protocol - gives the protocol you used like HTTP

req.get(host) - give host name with port no like localhost:8080