Properly root 404

This commit is contained in:
Thomas Wade 2018-10-17 10:47:21 +10:30
parent 8f5757e30c
commit bee021d7fd

View File

@ -6,9 +6,9 @@ var app = express();
app.use(express.static("./")); // Serve static files from root
app.use(express.json()); // Parse JSON in requests
app.use((req, res, next) => // Finally send a 404 page
app.use("/", (req, res, next) => // Finally send a 404 page
{
res.status(404).sendFile("/home/tom/Repos/WebDev-Assignment-2/404.html");
res.status(404).sendFile("404.html", {"root": "./"});
});
// Root route, respond with with index.html