AngularJS HTML5Mode

坚强是说给别人听的谎言 提交于 2019-11-28 11:13:00
jeff

Firebase just had a recent update that included this functionality. You can use it like so in your firebase.json:

"rewrites": [ {
    "source": "**",
    "destination": "/index.html"
} ]

This is the code sample used in their docs and will send any directory or file that is not found back to index.html.

It's important to note that you will need to update your firebase deployment tools to version 1.1.0 or higher for this to work:

$ npm update -g firebase-tools

You may need to use 'sudo' with this depending on your permissions.

You can read the documentation here: https://www.firebase.com/docs/hosting/guide/url-redirects-rewrites.html

You can read about updating firebase tools here: https://www.firebase.com/docs/hosting/guide/command-line-tool.html

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