From 51a19a53b1b9c52a82f308afaed30ef723e25928 Mon Sep 17 00:00:00 2001 From: David Reed Date: Tue, 1 Nov 2022 21:20:36 -0400 Subject: [PATCH] use 404.html --- src/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 5cc2ca3..14d75e7 100644 --- a/src/index.js +++ b/src/index.js @@ -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();