From xradiograph

NodeJs: Server - found via StackOverflow request for a simple HTTP server


This is dead-simple, and I regret not having this in my toolkit years ago.
Of course, I also regret not having Node Js in my toolkit years ago, too.



npm i -g http-server


usage: http-server [path] [options]

  -p                 Port to use [8080]
  -a                 Address to use []
  -d                 Show directory listings [true]
  -i                 Display autoIndex [true]
  -e --ext           Default file extension if none supplied [none]
  -s --silent        Suppress log messages from output
  --cors             Enable CORS via the 'Access-Control-Allow-Origin' header
  -o                 Open browser window after staring the server
  -c                 Set cache time (in seconds). e.g. -c10 for 10 seconds.
                     To disable caching, use -c-1.
  -h --help          Print this list and exit.




See Also




Category Tags


Retrieved from
Page last modified on May 07, 2014, at 11:52 AM