From 647c0c32f4ecd7a1f842e740924beb04847e93c1 Mon Sep 17 00:00:00 2001 From: BinBashBanana <51469593+BinBashBanana@users.noreply.github.com> Date: Tue, 1 Nov 2022 18:01:14 -0700 Subject: [PATCH] Better errors see https://github.com/titaniumnetwork-development/Ultraviolet-Static/pull/3 --- src/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.js b/src/index.js index b4bdf64..5cc2ca3 100644 --- a/src/index.js +++ b/src/index.js @@ -13,6 +13,11 @@ app.use(express.static(publicPath)); // The vendor's uv.config.js won't conflict with our uv.config.js inside the publicPath directory. app.use("/uv/", express.static(uvPath)); +// Error for everything else +app.use(function(req, res) { + res.status(404).sendFile(publicPath + "error.html"); +}); + const server = createServer(); server.on("request", (req, res) => {