socketioMEANseed/www/node_modules/http-server/README.md
www/node_modules/http-server/README.mdRaw
1# http-server: a command-line http server
2
3`http-server` is 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.
4
5
6
7# Installing globally:
8
9Installation via `npm`:
10
11 npm install http-server -g
12
13This will install `http-server` globally so that it may be run from the command line.
14
15## Usage:
16
17 http-server [path] [options]
18
19`[path]` defaults to `./public` if the folder exists, and `./` otherwise.
20
21# Installing as a node app
22
23 mkdir myapp
24 cd myapp/
25 jitsu install http-server
26
27*If you do not have `jitsu` installed you can install it via `npm install jitsu -g`*
28
29## Usage
30
31### Starting http-server locally
32
33 node bin/http-server
34
35*Now you can visit http://localhost:8080 to view your server*
36
37## Available Options:
38
39`-p` Port to use (defaults to 8080)
40
41`-a` Address to use (defaults to 0.0.0.0)
42
43`-d` Show directory listings (defaults to 'True')
44
45`-i` Display autoIndex (defaults to 'True')
46
47`-e` or `--ext` Default file extension if none supplied (defaults to 'html')
48
49`-s` or `--silent` Suppress log messages from output
50
51`--cors` Enable CORS via the `Access-Control-Allow-Origin` header
52
53`-o` Open browser window after starting the server
54
55`-c` Set cache time (in seconds) for cache-control max-age header, e.g. -c10 for 10 seconds (defaults to '3600'). To disable caching, use -c-1.
56
57`-U` or `--utc` Use UTC time format in log messages.
58
59`-P` or `--proxy` Proxies all requests which can't be resolved locally to the given url. e.g.: -P http://someurl.com
60
61`-S` or `--ssl` Enable https.
62
63`-C` or `--cert` Path to ssl cert file (default: cert.pem).
64
65`-K` or `--key` Path to ssl key file (default: key.pem).
66
67`-r` or `--robots` Provide a /robots.txt (whose content defaults to 'User-agent: *\nDisallow: /')
68
69`-h` or `--help` Print this list and exit.