Node equivalent of `python -m SimpleHTTPServer`?
Asked Answered
B

1

16

The existence of these modules suggests Node does not ship with an equivalent command:

Burnley answered 19/3, 2014 at 17:23 Comment(0)
A
16

There is a node package to do this.

$ npm install http-server -g
$ http-server

Node isn't aggressively batteries included like python so you have to install the pieces you want explicitly.

Arakawa answered 18/12, 2015 at 8:22 Comment(1)
Note that you can use npx to perform a one-off invocation of a npm-hosted module without installing it: simply run $ npx http-server in the command line.Perales

© 2022 - 2024 — McMap. All rights reserved.