简体   繁体   English

在不安装 npm 的情况下使用“npm”启动一个简单的 HTTP 服务器

[英]Starting a simple HTTP-server using "npm" without installing npm

Which command do I need to use to start a simple HTTP server using "npm", the specified port to be used is port 8080. Also, I don't have to download the npm package.我需要使用哪个命令来使用“npm”启动一个简单的 HTTP 服务器,要使用的指定端口是端口 8080。另外,我不必下载 npm ZEFE90A8E604A7C840E8ZD03A The only hint I got is that I can download the basic web server packet, also from there I can specify the port 8080?我得到的唯一提示是我可以下载基本的 web 服务器数据包,也可以从那里指定端口 8080?

Once the http server has been configured with the x-server name at port xxxx, you can start it with the command:一旦 http 服务器在端口 xxxx 上配置了 x-server 名称,您可以使用以下命令启动它:

x-server -p xxxx x-server -p xxxx

for example if my server's name is simple-http-server at port 8080:例如,如果我的服务器名称是端口 8080 上的 simple-http-server:

simple-http-server -p 8080简单的http服务器-p 8080

would start it.会启动它。

for the next exercice:下一个练习:

php -S 127.0.0.1:8080 php-S 127.0.0.1:8080

I am also getting started on HTB.我也开始使用 HTB。 contact me (in the next 23 hours) at this account or leave a correspondance as comment if you want to work with me to break through on HTB.如果您想与我一起在 HTB 上取得突破,请通过此帐户与我联系(在接下来的 23 小时内)或留下信件作为评论。

Once npm is installed, the command is simply: http-server -p 8080 (without writing ' npm ' at the beginning of the line).安装 npm 后,命令很简单: http-server -p 8080 (不要在行首写“ npm ”)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM