Skip to content

Commit

Permalink
Add not-found route
Browse files Browse the repository at this point in the history
  • Loading branch information
bertdeblock committed Mar 6, 2021
1 parent 3c2d7ab commit 94c0aeb
Show file tree
Hide file tree
Showing 8 changed files with 373 additions and 23 deletions.
2 changes: 2 additions & 0 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Router.map(function () {
this.route('payment-sent');
});

this.route('not-found', { path: '/*path' });

this.route('releases', function () {
this.route('beta');
this.route('canary');
Expand Down
14 changes: 14 additions & 0 deletions app/routes/not-found.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default class NotFoundRoute extends Route {
@service fastboot;

beforeModel() {
if (!this.fastboot.isFastBoot) {
return;
}

this.fastboot.response.statusCode = 404;
}
}
6 changes: 6 additions & 0 deletions app/templates/not-found.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{page-title "Page Not Found"}}

<div class="container">
<h1>Page Not Found</h1>
<p>We couldn't find what you were looking for.</p>
</div>
Loading

0 comments on commit 94c0aeb

Please sign in to comment.