Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start a web server in the current folder on the command line using Node or ClojureScript?

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?

like image 395
hawkeye Avatar asked Aug 15 '15 10:08

hawkeye


People also ask

Which method is start HTTP server in node JS?

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.


Video Answer


1 Answers

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
like image 144
Joe Young Avatar answered Oct 29 '22 16:10

Joe Young