Simple catch-all route for 404s on pages
This commit is contained in:
parent
2a1db3a09a
commit
e19740ce33
|
@ -35,6 +35,8 @@ Router.map(function() {
|
|||
if (config.environment === 'development') {
|
||||
this.route('freestyle');
|
||||
}
|
||||
|
||||
this.route('not-found', { path: '/*' });
|
||||
});
|
||||
|
||||
export default Router;
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
});
|
Loading…
Reference in New Issue