starting web server with npm

This is a question from Linux Fundaments on HTB academy.

I've been stuck with question for a while now. I've search google and entered several answers that I can guess. But none of them worked.

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)"

Here is the hint for the question.
"Npm is a package manager that can allow you to download a basic web server packet. This packet also provides the option to specify the port. No need to install it. How would the command look after installing the corresponding package with a specified listening port?"

Comments

  • You can find the npm website about simplehttpserver here --> https://www.npmjs.com/package/simplehttpserver .The command to start a webserver is simply "simplehttpserver [directory to be web root,default is the current working directory]".Also to install simplehttpserver through npm "npm install simplehttpserver -g".Hope it helps :)

  • @ThorMM said:

    This is a question from Linux Fundaments on HTB academy.

    I've been stuck with question for a while now. I've search google and entered several answers that I can guess. But none of them worked.

    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)"

    Here is the hint for the question.
    "Npm is a package manager that can allow you to download a basic web server packet. This packet also provides the option to specify the port. No need to install it. How would the command look after installing the corresponding package with a specified listening port?"

    This gets asked a few times because IMHO it is a badly worded question. The answer doesn't need npm.

    TazWake

    Note: https://www.nohello.com/

    Happy to help people but PLEASE explain your problem in as much detail as possible! If you say vague things like "It's not working", I cant help. This isn't Twitter so my DMs are always open.

  • Spoiler Removed

  • I have same question,use simplehttpserver 127.0.0.1:8080 & python -m SimpleHTTPServer but can't work,I don't know what problemt?

  • It feels like any attempt to be more specific with an answer here gets flagged as a spoiler. This question gets asked a lot which implies people are struggling with it, but every thread is littered with Spoiler Removed messages.

    TazWake

    Note: https://www.nohello.com/

    Happy to help people but PLEASE explain your problem in as much detail as possible! If you say vague things like "It's not working", I cant help. This isn't Twitter so my DMs are always open.

  • just a hint forget about any local host or any ip address

  • Very badly worded question lost a few hours on that because of the word simple. Also not much online this help https://gist.github.com/willurd/5720255

    ”No questions a stupid question”
    <img src="https://www.hackthebox.eu/badge/team/image/1805" alt="Hack The Box">
  • Thanks m0j0r1s1n that link helped.
    I think the issue with this question is that there has been no mention of this process in the module to this point which makes it pretty hard or someone with no linux knowledge to figure out the answer

  • Thanks m0j0r1s1n that linked helped as well. I will spread your wisdom!

Sign In to comment.