diff --git a/package-lock.json b/package-lock.json index 5d4f971..160e130 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2013,7 +2013,7 @@ }, "node_modules/ultraviolet-static": { "version": "1.0.2", - "resolved": "git+ssh://git@github.com/titaniumnetwork-development/Ultraviolet-Static.git#97155032e6082a86d9f701bd1bd729fe3593e137", + "resolved": "git+ssh://git@github.com/titaniumnetwork-development/Ultraviolet-Static.git#298cc59dd54f4f3df5e36f41b149493d3a2ff092", "peerDependencies": { "ultraviolet": "https://github.com/titaniumnetwork-development/Ultraviolet/releases/download/v1.0.1/ultraviolet-1.0.1.tgz" } @@ -3533,7 +3533,7 @@ } }, "ultraviolet-static": { - "version": "git+ssh://git@github.com/titaniumnetwork-development/Ultraviolet-Static.git#97155032e6082a86d9f701bd1bd729fe3593e137", + "version": "git+ssh://git@github.com/titaniumnetwork-development/Ultraviolet-Static.git#298cc59dd54f4f3df5e36f41b149493d3a2ff092", "from": "ultraviolet-static@github:titaniumnetwork-development/Ultraviolet-Static", "requires": {} }, diff --git a/src/index.js b/src/index.js index b4bdf64..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(); @@ -13,6 +14,12 @@ 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((req, res) => { + res.status(404); + res.sendFile(join(publicPath, "404.html")); +}); + const server = createServer(); server.on("request", (req, res) => {