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 { createServer } from "node:http";
|
||||||
import { publicPath } from "ultraviolet-static";
|
import { publicPath } from "ultraviolet-static";
|
||||||
import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
|
import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
|
||||||
|
import { join } from "node:path";
|
||||||
|
|
||||||
const bare = createBareServer("/bare/");
|
const bare = createBareServer("/bare/");
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
@ -14,8 +15,9 @@ app.use(express.static(publicPath));
|
||||||
app.use("/uv/", express.static(uvPath));
|
app.use("/uv/", express.static(uvPath));
|
||||||
|
|
||||||
// Error for everything else
|
// Error for everything else
|
||||||
app.use(function(req, res) {
|
app.use((req, res) => {
|
||||||
res.status(404).sendFile(publicPath + "error.html");
|
res.status(404);
|
||||||
|
res.sendFile(join(publicPath, "404.html"));
|
||||||
});
|
});
|
||||||
|
|
||||||
const server = createServer();
|
const server = createServer();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue