3
votes

So I'm trying to get ember to use the history api for it's routing to get rid of the hashbangs. But when I use

App.Router.reopen({
    location: 'history'
});

I get the following error

Assertion failed: The URL '/ember-store/' did not match any routes in your application

I'm using MAMP for my localhost server and all the projects are just sub folders in the htdocs folder. The folder that the whole app and index.html files for this ember.js app are in is called "ember-store". How do I fix this issue so I can use the history API correctly?

1
Well not according to what they were saying, it has something to do with overriding the browsers default behavior which is to route the client to those directories and instead map them to states in the app. - Jordan

1 Answers

3
votes

If you want your Ember app to route within a path segment, you need to tell the Ember Router what your root URL is. To do this in your case, change your code above to:

App.Router.reopen({
    location: 'history',
    rootURL: '/ember-store/'
});

http://emberjs.com/guides/routing/#toc_specifying-a-root-url