LINUX Fundamentals_Starting web server with npm

This is a question from Linux Fundaments on HTB academy.

Here is the question.
“Find a way to start a simple HTTP server using “npm”. Submit the command that starts the web server on port 8080 (use the short argument to specify the port number)”

I use command “simplehttpserver 127.0.0.1:8080” & “python -m SimpleHTTPServer 8080”,but can’t work,I don’t know what problemt?

2 Likes

Spoiler Removed

1 Like

Go on with following:

simplehttpserver -p 8080 127.0.0.1

I think this one worked for me, but I cannot remember exactly to be honest.

im having the same problem i tried http-server -p and npm http-server -p

This question was poorly worded. It wasn’t until I found someone who posted the following link that helped me. Big list of http static server one-liners · GitHub

6 Likes

Thank you m0j0r1s1n for his wisdom

http-server -p 8080

3 Likes

http-server -p 8080
Only be aware of spaces !!

http-server -p 8080
Use this one.