英文:
How to start deployed Angular application locally
问题
我已部署了Angular前端,在服务器上它工作正常,有三个脚本:
/runtime.0fad6a04e0afb2fa.js
/polyfills.24f3ec2108a8e0ab.js
/main.a9b28b9970fe807a.js
我想在Firefox中启动这个应用程序,不使用IIS或Apache,只需点击Html页面。这可能吗?
但Firefox告诉我:
跨源请求被阻止:同源策略禁止读取file:///runtime.0fad6a04e0afb2fa.js上的远程资源。 (原因:CORS请求不是HTTP)。
是否可能解除此限制?或者Firefox永远不允许我加载和运行这些脚本?
英文:
I have deployed Angular frontend, on server it working fine, there are 3 script
/runtime.0fad6a04e0afb2fa.js
/polyfills.24f3ec2108a8e0ab.js
/main.a9b28b9970fe807a.js
I want to start this application in Firefox, without IIS or Apache - by simple click to Html-page. Is it possible?
But Firefox said me
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///runtime.0fad6a04e0afb2fa.js. (Reason: CORS request not http).
Is it possible to remove this restriction? Or Firefox never allow me loading and working this scripts?
答案1
得分: 1
这是一个CORS策略错误,您需要在类似nodejs HTTP-server的http服务器上运行应用程序。
英文:
Its a CORS policy error, you need to run applications on an http-server like
nodejs HTTP-server
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论