Set the root path without project name

How do I fix the path that chrome sees on my projects? For example the url in the browser looks like:

http://localhost:63342/myproject/index.html

I want it to look like: 

http://localhost:63342/index.html

I've tried changing the Content Resource Root but it doesn't make a difference. It's set to /home/"username"/myproject,

If I can correct this my links to stylesheets and images will work correctly and I'll actually be able to use WebStorm. 

I'm using a Ubuntu 16.04 64 bit workstation, and Webstorm 2017.3.2

3 comments


The built-in web server serves files from http://localhost:63342/<project name> (this is done to allow serving several projects at once).
There is no way to set it up to use http://localhost:63342/ URL. But you can configure it to use URLs like http://<project_name>:<port> where the 'project name' is a name specified in hosts file, like 127.0.0.1 project_name. See https://youtrack.jetbrains.com/issue/WEB-8988#comment=27-577559.

But, rather than changing hosts, etc., I'd suggest using different server (Apache, etc.) to host your application if you like it being served from the root.

1

Thanks Elena,

Out of curiosity, why do you recommend using a different server over changing the hosts file?

best,

-james

0

The built-in webserver is a simple solution for development - it has some limitations as compared to full-functional web server, and you will still need a different server for production. Also, we have some reports regarding performance degradation when debugging applications with modified hosts.

1

Please sign in to leave a comment.