Rubymine(Jetbrains) local server. Can I get it to run from localhost root?

不想你离开。 提交于 2019-12-17 20:32:46

问题


Currently when I open the html file I'm working on it takes me to

http://localhost:63342/project-folder/index.html

Is there a way to set Rubymine to run my project from the root, eg.

http://localhost:63342/index.html

回答1:


http://localhost:63342/index.html -- you cannot have this kind of URL with built-in web server .. as IDE does not know what project to serve (as it works for ALL your projects a not only currently opened).

When built-in web server is in use, the URL has to have some hint (PROJECT_NAME) that would tell what project to serve (where to take files from).

Built-in web server supports 2 kind of URLs (both of them will serve the same file):

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

If you want 2nd URL, then you will have to do these steps:

A: Create Deployment entry (Settings | Deployment) and mark it as Default for this project. The URL defined there (http://PROJECT_NAME:63342/) will be used when opening pages from within IDE.

B: In your hosts file (or your local DNS server, if you have one) define an entry that would point PROJECT_NAME to your IP. For example (for hosts file): 127.0.0.1 PROJECT_NAME



来源:https://stackoverflow.com/questions/24899610/rubyminejetbrains-local-server-can-i-get-it-to-run-from-localhost-root

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!