Intellij idea 如何在intellij中为web浏览器预览配置应用程序根路径
我正在开发一个Angular应用程序,它是一个单页应用程序,托管在sayIntellij idea 如何在intellij中为web浏览器预览配置应用程序根路径,intellij-idea,webstorm,Intellij Idea,Webstorm,我正在开发一个Angular应用程序,它是一个单页应用程序,托管在saysrc/main/webapp/index.html 使用脚本引用,如 <script type="text/javascript" src="/vendors/jquery/1.12.0/jquery.min.js"></script> <script type="text/javascript" src="/vendors/bootstrap/3.3.6/js/bootstrap.min.j
src/main/webapp/index.html
使用脚本引用,如
<script type="text/javascript" src="/vendors/jquery/1.12.0/jquery.min.js"></script>
<script type="text/javascript" src="/vendors/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/vendors/angularjs/1.4.9/angular.js"></script>
<script type="text/javascript" src="/vendors/angularjs/1.4.9/angular-animate.js"></script>
然后浏览器尝试从中加载脚本
http://localhost:63342/vendors/jquery/1.12.0/jquery.min.js
基本上就是坐在
http://localhost:63342/myApp/main/webapp/vendors/jquery/1.12.0/jquery.min.js
我想知道是否有办法为intellij配置设置应用程序根路径
提前感谢。:)
PS:js/html/css开发人员在快速代码和测试周期中通常使用什么方式?我对Angular不太熟悉。。但它如何在真实的网站上工作呢?我的意思是:“实际位于
src/main/webapp/vendors/jquery/1.12.0/jquery.min.js
”在任何情况下:尝试将src/main/webapp/
标记为资源根目录。至于从URL中删除/myApp
,唯一的选择是使用http://myApp:63342/
URL的类型,而不是http://localhost:63342/myApp/
(因为IDE仍然需要知道服务于哪个项目;就像任何合适的web服务器一样)——或者
http://localhost:63342/vendors/jquery/1.12.0/jquery.min.js
http://localhost:63342/myApp/main/webapp/vendors/jquery/1.12.0/jquery.min.js