Properly root 404
This commit is contained in:
parent
8f5757e30c
commit
bee021d7fd
@ -6,9 +6,9 @@ var app = express();
|
|||||||
|
|
||||||
app.use(express.static("./")); // Serve static files from root
|
app.use(express.static("./")); // Serve static files from root
|
||||||
app.use(express.json()); // Parse JSON in requests
|
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
|
// Root route, respond with with index.html
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user