diff --git a/server.js b/server.js index 2f7d9a5..04be1f4 100644 --- a/server.js +++ b/server.js @@ -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