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') { if (config.environment === 'development') {
this.route('freestyle'); this.route('freestyle');
} }
this.route('not-found', { path: '/*' });
}); });
export default Router; 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);
},
});