Where to define routes in Ember CLI?
ember-cli, ember.js, javascript
Solution
They should be defined in the `app/router.js` file.
Since you used `ember generate route` it's likely that a route is already defined there for you, you'll just need to update it.
Problem
I've created some routes using `ember generate route {my_route_name}` and it creates a js file under routes and a hbs file under templates Now I want to define these routes like ``` App.Router.map(function() { this.resource('posts'); this.resource('post', { path: '/post/:post_id' }); }); ``` But where do I do that in `ember-cli`? I've tried adding it in the `app.js` file right under this code ``` var App = Ember.Application.extend({ modulePrefix: 'front', // TODO: loaded via config Resolver: Resolver }); ``` But that gives me an error: `Uncaught TypeError: Cannot read property 'map' of undefined` So I am a little confused as to where to actually define all my routes?