To start a web server in the current directory on the command line, I'm using:
python -m SimpleHTTPServer
I'd like to do this using Node or ClojureScript.
My question is: How to start a web server in the current folder on the command line using Node or ClojureScript?
The http module is a core module of Node. js, so no need to install it using NPM. The next step is to call createServer() method of http and specify callback function with request and response parameter.
From Big list of http static server one-liners
$ npm install -g http-server # install dependency $ http-server -p 8000
or
$ npm install -g node-static # install dependency $ static -p 8000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With