File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { EVENT_BUS } from "./" ;
2
+ import { buildErrorPage } from "../views/error404.ts" ;
2
3
3
4
type RouteHandler = ( params ?: Record < string , string > ) => void ;
4
5
@@ -27,6 +28,7 @@ class Router {
27
28
return ;
28
29
}
29
30
}
31
+ buildErrorPage ( ) ;
30
32
console . error ( `No handler found for path: ${ path } ` ) ;
31
33
}
32
34
Original file line number Diff line number Diff line change 1
-
2
- export function buildErrorPage ( ) {
1
+ import { writeTitle } from "./utils" ;
2
+ import { renderView } from "./index.ts" ;
3
+
4
+
5
+ function errorView ( ) {
6
+ const article = document . createElement ( 'article' ) ;
7
+ const viewTitle = writeTitle ( "h1" , "Page not found 404" ) ;
3
8
9
+ article . appendChild ( viewTitle ) ;
10
+ return article ;
11
+ }
12
+
13
+ //-----------------------------------------------------------------------
14
+
15
+ export function buildErrorPage ( ) {
16
+ renderView ( errorView ( ) ) ;
4
17
}
You can’t perform that action at this time.
0 commit comments