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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With