Answers for "find my url in nodejs"

0

find my url in nodejs

const url =req.protocol + '://' + req.headers.host + req.originalUrl;

console.log(url) //http://localhost:3000/products

or
const url =req.protocol + '://' + req.headers.host + req.baseUrl;

console.log(url) //http://localhost:3000/products
Posted by: Guest on April-29-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language