use 404.html
This commit is contained in:
parent
647c0c32f4
commit
51a19a53b1
1 changed files with 4 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ import express from "express";
|
|||
import { createServer } from "node:http";
|
||||
import { publicPath } from "ultraviolet-static";
|
||||
import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
|
||||
import { join } from "node:path";
|
||||
|
||||
const bare = createBareServer("/bare/");
|
||||
const app = express();
|
||||
|
|
@ -14,8 +15,9 @@ app.use(express.static(publicPath));
|
|||
app.use("/uv/", express.static(uvPath));
|
||||
|
||||
// Error for everything else
|
||||
app.use(function(req, res) {
|
||||
res.status(404).sendFile(publicPath + "error.html");
|
||||
app.use((req, res) => {
|
||||
res.status(404);
|
||||
res.sendFile(join(publicPath, "404.html"));
|
||||
});
|
||||
|
||||
const server = createServer();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue