Ember.js app, Parse throws 404 for any path but root

蓝咒 提交于 2019-12-23 02:27:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!