[WebStorm]: change debugging WebServer Project Root

Since then I have been using JetBrains WebStorm, and I really like it, but I have a problem, and after several hours of searching here and in the documentation, I decided to open my own question, because I just did not find it.

I have a project that is stored on my local computer in the following location: C:\Projects\Github\OfficeUI.Beta

Now I opened this folder in WebStorm, which causes it to do the following:

enter image description here

When I debug WebSite right now, everything works under the following Uri: http://localhost:63342/OfficeUI.Beta/

And there is a problem with this, because it works in this directory, in every CSS, JavaScript and other files I need to put the following: /OfficeUI.Beta/Resources/... , while I would like to use: /Resources/...

How to do it? I think I need to change the configuration of WebStorm to start the site under the root http://localhost/ , but I can not find it.

Any help is appreciated.

+8
webstorm
source share
2 answers

According to the help page, the URL should be http://localhost:<built-in server port>/<project root> . However, there is a workaround :

Edit the file / etc / hosts:

 127.0.0.1 projectName 

And set the custom port: Settings -> Debugger -> JavaScript -> Built-in server port 8090 . In the new version, it should be: Settings -> Build, Execution, Deployment -> Debugger

The URL will look like this: http://projectName:8090

Another workaround would be to use the embedded PHP server where you can determine the root of the document. But this does not allow you to debug Javascript.

+6
source share

As Darek Kay has already suggested, the only "workaround" that I know for using the embedded WebStorm server with absolute URLs is to edit the / etc / hosts file (on Mac / Linux) or C: \ Windows \ System32 \ drivers \ etc \ hosts (on Windows). In your case, you change the line 127.0.0.1 localhost to 127.0.0.1 OfficeUI.Beta . Then you set the custom port for the embedded server by going to Settings -> Debugger -> JavaScript -> Built-in server port 8090 (in older versions of WebStorm) or by going to Settings -> Build, Execution, Deployment -> Debugger -> Built-in server port 8090 (in new versions of WebStorm). Once you do this, you can go to http://OfficeUI.Beta:8090 , and absolute URLs should work.

I would choose to configure the web server locally (Apache, MAMP, WAMP, etc.) to host your web project, since the embedded WebStorm server is very simple and does not affect this use case.

I got this information by visiting http://blog.jetbrains.com/webstorm/2013/03/built-in-server-in-webstorm-6/ and watching the comment of Vladimir Krivosheev on July 2, 2013 at 6:52.

+1
source share

All Articles