1. “File” -> “Settings…”, 打开设置界面
2. 选中”Debugger”【调试程序】, Port输入”9090″, “Allow unsigned requests”选中, 打钩
3. 选中”Deployment”, 点击”+”, Name置为”Localhost”, Type选择为”Local or mounted folder”
4. 设置”Connection”, 设置Folder, 我自己的项目文件是在”E:\Work_V1_B\branch\dggschoo\04_Coding\WebSites\Dgg.Web.Static”下, Web server root URL设置为”http://172.16.3.135:9090″, IP是自己电脑的
注:Web server root URL: http://172.16.3.135:9090, 点击界面里的浏览器, 自动打开的地址如下:
http://172.16.3.135:9090/index.html
上面的地址是打不开的, 因为我是放在Dgg.Web.Static文件下的,
所以应修改成 Web server root URL: http://172.16.3.135:9090/Dgg.Web.Static
OK 能正常访问了
5. “Mappings”下保持不变, 点击”OK”, 即可
6. OK,设置完成,现在用webstorm直接页面预览,可以看到页面地址
已经由原先的:http://localhost:63342/****.html
更改为现在的:http://172.16.3.135:9090/****.html
直接复制这个路径给你的小伙伴吧,只要他们的设备和你的电脑保持在同局域网,即可打开预览了.
二、在nginx下配置:
nginx服务器,如何支持ssi包含文件。
主要是三个参数,ssi,ssi_silent_errors和ssi_types,均可以放在http,server和location的作用域下。
ssi on
开启ssi支持,默认是off
ssi_silent_errors on
默认值是off,开启后在处理SSI文件出错时不输出错误提示:”[an error occurred while processing the directive] ”
ssi_types
默认是ssi_types text/html,所以如果需要htm和html支持,则不需要设置这句,如果需要shtml支持,则需要设置:ssi_types text/shtml
SSI的格式:
<!–#include file=”bottom.htm”–>
或
<!–#include virtual=”/hx/bottom.htm”–>
路径是相对server中root根目录。
更多请参见官方文档:http://wiki.nginx.org/NginxChsHttpSsiModule
示例:
server { listen 1212; server_name 172.16.3.135; ssi on; ssi_silent_errors on; ssi_types text/shtml; root "E:/Work_V1_B/branch/dggschoo/04_Coding/WebSites/Dgg.Web.Static/"; location / { index index.html index.htm index.shtml; } }
About the author