问题
I have an ember app that is served by Parse hosting, and for the most part it's working great if the user starts at the root URL (for which Parse serves up the public/index.html file). However, if a user loads the page at any path, say, /about, Parse will look for a public/about.html file, which doesn't exist (ember serves everything from the index.html file). Parse throws a 404 for any path but the root. How do I get around this?
I have a mini Express app setup, perhaps I could catch all routes and render the index.html file that's in the public folder? The docs only talk about rendering templates from the cloud/views folder (not the public folder, which is where the index.html file is).
Update / Clarification:
This is not an issue with Ember itself (the app works fine on my local machine). The issue is with Parse. When a URL, parseapp.com/entries, is loaded, parse looks for a file in the cloud/public folder called entries.html. There is no such file, this app is an ember app, and ember is loaded from the index.html file. Thus, for every path, I need parse to load the public/index.html file (and then ember routing will take care of the rest).
来源:https://stackoverflow.com/questions/26107973/ember-js-app-parse-throws-404-for-any-path-but-root