app.get("/", (req, res, next) => {
var fullUrl = req.protocol + ‘://’ + req.get(‘host’) + req.originalUrl;
console.log(fullUrl);
next();
res.sendFile(__dirname + “/views/index.html”);
});
this code is not working, why??
The site remains loading
app.get("/", (req, res, next) => {
var fullUrl = req.protocol + ‘://’ + req.get(‘host’) + req.originalUrl;
console.log(fullUrl);
next();
res.sendFile(__dirname + “/views/index.html”);
});
this code is not working, why??
The site remains loading
Can you show us your logs?
You don’t need to call the next() function.
yes next() is only for middleware not for simple get requests.