add: 404 not found

This commit is contained in:
AdrienLSH 2023-12-14 13:55:31 +01:00
parent 072c97d1c0
commit c303042588
2 changed files with 19 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import RegisterView from "./views/accounts/RegisterView.js";
import LogoutView from "./views/accounts/LogoutView.js"; import LogoutView from "./views/accounts/LogoutView.js";
import GameView from "./views/Game.js" import GameView from "./views/Game.js"
import PageNotFoundView from './views/PageNotFoundView.js'
import AbstractRedirectView from "./views/AbstractRedirectView.js"; import AbstractRedirectView from "./views/AbstractRedirectView.js";
import MeView from "./views/MeView.js"; import MeView from "./views/MeView.js";
@ -62,7 +63,10 @@ const router = async (uri) => {
if (!match) { if (!match) {
match = { match = {
route: routes[0], route: {
path: uri,
view: PageNotFoundView
},
result: [uri] result: [uri]
}; };
} }

View File

@ -0,0 +1,14 @@
import AbstractView from "./AbstractView.js";
export default class extends AbstractView {
constructor(params) {
super(params, "Dashboard");
}
async getHtml() {
return `
<h1>404 Bozo</h1>
<p>Git gud</p>
`;
}
}