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?

3 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

1 Like

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

8 Likes

Thank you m0j0r1s1n for his wisdom

http-server -p 8080

4 Likes

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

http-server -p 8080
Use this one.

I started one with http-server -p 8080 and it did start a server but it wasn’t the answer HTB wants. :man_shrugging:

Correction. It is the answer, must have been a space in there I didn’t clock.