Thursday 26 September 2019

NodeJS: How to get URL?

I want localhost:3000, localhost:3000/blahblah, and localhost:3000/anythingatall to all open index.html like localhost:3000 does. But I also want to get the full URL path to store it in a variable.How?What do I put after this?app.use(express.static(path.join(__dirname, ''))) server.listen(port, () => { console.log(`Server running on port ${port}.`) })

Submitted September 27, 2019 at 07:15AM by MelerEcckmanLawler

No comments:

Post a Comment