Why does it report Cannot GET a certaion route error?


#1

Here is my router.js:

App.Router.map(function() {
    this.resource('stores');       
});

And the route of stores:

App.StoresRoute = Ember.Route.extend({
  model: function() {
    return [];
  }
});

If I use {{#link-to 'stores'}}stores{{/link-to}}, I can view stores page without error, but when I refresh the page under stores page, it will report Cannot GET /stores, why does this happen?

How could I solve this issue?

Thanks.


#2

I wrote the following in my code:

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

Will this be the root cause of this problem?


#3

What are you using to serve your application?


#4

I don’t want to see ‘#’ in the url, but it’s ok, I deleted location: ‘auto’ to solve this problem. Thank you:)