For Node, there's http-server
:
$ npm install -g http-server
$ http-server Downloads -a localhost -p 8080
Starting up http-server, serving Downloads on port: 8080
Hit CTRL-C to stop the server
Python has:
- Python 3:
python -m http.server --bind 127.0.0.1 8080
- Python 2:
python -m SimpleHTTPServer 8080
Note that Python 2 has no --bind
option, so it will allow all connections (not just from localhost
).