From c3030425882d84a0e849a1ccdbcc8e337920288b Mon Sep 17 00:00:00 2001 From: AdrienLSH Date: Thu, 14 Dec 2023 13:55:31 +0100 Subject: [PATCH] add: 404 not found --- frontend/static/js/index.js | 6 +++++- frontend/static/js/views/PageNotFoundView.js | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 frontend/static/js/views/PageNotFoundView.js diff --git a/frontend/static/js/index.js b/frontend/static/js/index.js index 8057fae..57a01c2 100644 --- a/frontend/static/js/index.js +++ b/frontend/static/js/index.js @@ -8,6 +8,7 @@ import RegisterView from "./views/accounts/RegisterView.js"; import LogoutView from "./views/accounts/LogoutView.js"; import GameView from "./views/Game.js" +import PageNotFoundView from './views/PageNotFoundView.js' import AbstractRedirectView from "./views/AbstractRedirectView.js"; import MeView from "./views/MeView.js"; @@ -62,7 +63,10 @@ const router = async (uri) => { if (!match) { match = { - route: routes[0], + route: { + path: uri, + view: PageNotFoundView + }, result: [uri] }; } diff --git a/frontend/static/js/views/PageNotFoundView.js b/frontend/static/js/views/PageNotFoundView.js new file mode 100644 index 0000000..cff748e --- /dev/null +++ b/frontend/static/js/views/PageNotFoundView.js @@ -0,0 +1,14 @@ +import AbstractView from "./AbstractView.js"; + +export default class extends AbstractView { + constructor(params) { + super(params, "Dashboard"); + } + + async getHtml() { + return ` +

404 Bozo

+

Git gud

+ `; + } +}