diff --git a/locales/en_US.json b/locales/en_US.json index 3d09522..cb4d5e2 100644 --- a/locales/en_US.json +++ b/locales/en_US.json @@ -391,5 +391,8 @@ "cancel": "Cancel", "confirm": "Confirm", "close": "Close" + }, + "notfound": { + "description": "Oops! We could not find this page." } } diff --git a/public/assets/css/404.css b/public/assets/css/404.css new file mode 100644 index 0000000..016adc0 --- /dev/null +++ b/public/assets/css/404.css @@ -0,0 +1,24 @@ +.status { + text-align: center; + font-size: 8rem; + padding-top: 60px; + color: var(--text-shade-1); +} +.description { + text-align: center; + font-size: 1.7rem; + margin-top: -10px; + color: var(--text-shade-1); +} +.shocked-bandwidth { + display: block; + margin-left: auto; + margin-right: auto; + margin-top: 70px; + margin-bottom: -120px; +} +@media screen and (max-width: 900px) { + .shocked-bandwidth { + margin-bottom: -100px; + } +} \ No newline at end of file diff --git a/public/assets/images/shockedbandwidth.svg b/public/assets/images/shockedbandwidth.svg new file mode 100644 index 0000000..702169c --- /dev/null +++ b/public/assets/images/shockedbandwidth.svg @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/server.js b/src/server.js index 853e33e..b73bdde 100644 --- a/src/server.js +++ b/src/server.js @@ -113,10 +113,9 @@ app.use('/nso-legacy-pack', routes.aprilfools); logger.info('Creating 404 status handler'); // This works because it is the last router created // Meaning the request could not find a valid router -app.use((request, response, next) => { +app.use((request, response) => { const fullUrl = util.fullUrl(request); - logger.warn(`HTTP 404 at ${fullUrl}`); - next(); + response.render('404'); }); logger.info('Setting up handlebars engine'); diff --git a/views/404.handlebars b/views/404.handlebars new file mode 100644 index 0000000..3a49409 --- /dev/null +++ b/views/404.handlebars @@ -0,0 +1,10 @@ + + +{{> header}} + +
+
404
+
{{ locale.notfound.description }}
+ + {{> footer }} +
\ No newline at end of file