Using both ember routes and express routes

In ember I have all the routes that my app needs, so my question is which routes do I need to define in Express? Are they necessary or can be omitted them?

Short answer, no you don’t duplicate the routes. In express, you build basically a “catch all” route that just returns index.html. So no matter what URL you hit, your webserver always returns index.html and the routing is then left up the ember’s router to resolve.

An example of this can be found in the “deprecated” ember-app-kit’s usage of express.

https://github.com/stefanpenner/ember-app-kit/blob/master/tasks/express-server.js#L66 https://github.com/stefanpenner/ember-app-kit/blob/master/tasks/express-server.js#L90-L122

1 Like