我一直在使用 nodejs http-server 来提供我的 Angular 应用程序,但它不能很好地处理 HTML5 位置,因为使用它们需要服务器进行重定向,而 http-server 不会这样做。所以我看到了一个尝试的建议超静态的 https://www.npmjs.com/package/superstatic,并安装了它。然后我设置以下 superstatic.json 文件:
{
"routes": {
"Admin/**":"/index.html",
"Give/**":"/index.html",
"Pending/**":"/index.html",
"Store/**":"/index.html"
}
}
我用它启动了
superstatic --config superstatic.json
如果我从“/”开始,它会正确地为我的应用程序提供服务,但会重新加载index.html文件,但不对该文件进行任何角度处理。
有人成功地将超静态与角度结合使用吗?
我通过设置我的superstatic.json
像这样:
{
"rewrites": [
{"source":"/**","destination":"/index.html"}
]
}
然后运行它
superstatic --config superstatic.json
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)