http-serveris a simple, zero-configuration command-line http server. It is powerful enough for production usage, but it's simple and hackable enough to be used for testing, local development, and learning.
Installing globally:
Installation vianpm. If you don't havenpmyet:
curl https://npmjs.org/install.sh | sh
Once you havenpm:
npm install http-server -g
This will installhttp-serverglobally so that it may be run from the command line.
Usage:
http-server [path] [options]
[path]defaults to./publicif the folder exists, and./otherwise.
Installing as a node app
mkdir myapp
cd myapp/
jitsu install http-server
If you do not havejitsuinstalled you can install it vianpm install jitsu -g
Usage
Starting http-server locally
node bin/http-server
Now you can visit http://localhost:8080 to view your server
Deploy http-server to nodejitsu
jitsu deploy
You will now be prompted for asubdomainto deploy your application on
Available Options:
-pPort to listen for connections on (defaults to 8080)
-aAddress to bind to (defaults to '0.0.0.0')
-dShow directory listings (defaults to 'True')
-iDisplay autoIndex (defaults to 'True')
-eor--extDefault file extension (defaults to 'html')
-sor--silentIn silent mode, log messages aren't logged to the console.
-hor--helpDisplays a list of commands and exits.
-cSet cache time (in seconds) for cache-control max-age header, e.g. -c10 for 10 seconds. To disable caching, use -c-1.