Open existing Website / Visual Studio to WebStorm
Hi,
I'm new to WebStorm and having issues opening a previous project that I use in Visual Studio.
Its an AngularJS project and in Visual Studio I could add it by "Add existing website". I would launch the site by right clicking the index.html page, open in browser and the whole app loads.
In WebStorm, the internal webhost adds a project folder in the site URL. The URL to the index page becomes "http://localhost:63342/MyProject/index.html"
The issue is the site and all the code expects "http://localhost:63342/index.html". So all the files referenced in index.html tries to load throw 404 errors.
I saw in the Javascript debug configuration that I can set a "Remote URL" for each file, however that doesn't seem to fix any of the missing files.
Is there another way to load this project so it doesn't add the folder name to the URL?
Please sign in to leave a comment.
WebStorm built-in web server is not configurable, it always serves static assets from
localhost:63342/project_name, there is no way to set it up to serve files from the root.If you like to use URLs relative to server root (the ones starting with slash), you have to use a 'normal' web server (Apache, etc.) to host your files and configure it in the way you like.
If using absolute paths is not a requirement, just change paths to relative to current page, like
<script src="bower_components/angular/angular.min.js"></script>if yourindex.htmlis in the same folder asbower_components