http服务器在后台运行

问题描述 投票:0回答:1

我安装了npm http-server,并且可以很好地共享我希望所有本地PC都可以访问的目录。但是我可以使其在后台运行吗?我正在通过cmd运行它。我尝试了以下方法:

http-server . &

并且永久安装npm之后

forever start -c http-server

他们都没有为我工作。它是Windows服务器。

有什么建议吗?

node.js npm cmd server httpserver
1个回答
1
投票
//first of all locate your http-server VIA
 $ which http-server

//You should get something like this /usr/bin/http-server

//Then cd to the directory you want to serve files from and execute:
    forever start /usr/bin/http-server -p 80 -d false
© www.soinside.com 2019 - 2024. All rights reserved.