I am using Express 4.x. and I'm in a function like:
async function getIndexHTML(req, res) {
}
When I try to log error like this:
console.error(req);
It returns a [Object]
When I try to do this:
console.error(JSON.stringify(req));
It comes with another error
--> starting at object with constructor 'Socket'
1|testprj | | property 'parser' -> object with constructor 'HTTPParser'
1|testprj | --- property 'socket' closes the circle
1|testprj | at JSON.stringify ()
1|testprj | at getIndexHTML (/root/mytest/app.js:114:24)
I just want to know what exact URL the user is typing into the addressbar. What should I do?