use 404.html

This commit is contained in:
David Reed 2022-11-01 21:20:36 -04:00
parent 647c0c32f4
commit 51a19a53b1
No known key found for this signature in database
GPG key ID: 2211691D8A1EE72F

View file

@ -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();