Simple catch-all route for 404s on pages

This commit is contained in:
Michael Lange 2017-09-28 17:18:28 -07:00
parent 2a1db3a09a
commit e19740ce33
2 changed files with 13 additions and 0 deletions

View file

@ -35,6 +35,8 @@ Router.map(function() {
if (config.environment === 'development') {
this.route('freestyle');
}
this.route('not-found', { path: '/*' });
});
export default Router;

View file

@ -0,0 +1,11 @@
import Ember from 'ember';
const { Route, Error: EmberError } = Ember;
export default Route.extend({
model() {
const err = new EmberError('Page not found');
err.code = '404';
this.controllerFor('application').set('error', err);
},
});