The existence of these modules suggests Node does not ship with an equivalent command:
Node equivalent of `python -m SimpleHTTPServer`?
Asked Answered
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.
© 2022 - 2024 — McMap. All rights reserved.
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