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 ` +
Git gud
+ `; + } +}