doc-server
a simple and friendly static-file server, with live reload and markdown support for node
doc-server was inspired by some of the other static-file serving modules out there, such as node-static and md-server.
Install
$ npm install doc-server -g
Usage
$ doc-server
Options
usage: doc-server [OPTIONS] [directory] Options: Server Options: -p INT, --port=INT TCP port at which the files will be served. -a 127.0.0.1, --host-addresss=127.0.0.1 Begin accepting connections on the specified host. If the host is omitted, the server will accept connections directed to any IPv4 address. -l, --no-log Disable logging requests and file reloads in console. -t TYPE, --log-type=TYPE Log format. Possible values are "combined", "common", "dev", "short" or "tiny". -q, --log-request Log request data. -e, --no-respond-error Disable respond error and stack-trace back to requester. -r INT, --reload-delay=INT Interval in ms, which the server monitors the file system and reload webpage. -d, --no-parser-md Disable markdown parser. -y TYPE, --md-type=TYPE Markdown handler to use. Possible value are "mdwiki" and "marked". -c, --no-livereload Disable live reload. -m INT, --max-age=INT Set the max-age property of the Cache-Control header in milliseconds or a string in ms format. --headers-file=headers.json JSON file of additional headers. -g, --no-compress Disable compression. Authentication: -u user, --username=user Username to authenticate. -w pass, --password=pass Password to authenticate. Static Options: --static-dotFile=ARG Option
Examples
# serve up the current directory $ doc-serverdoc-server serving '.' http://any:8080 # serve up a different directory, port and host $ doc-server test -p 8082 -a 172.31.24.40doc-server serving 'test' http://172.31.24.40:8082 # specify additional headers (this one is useful for development) $ echo '{ "custom": "header", "anothercustom": "header" }' > headers.json $ doc-server --headers-file=headers.jsondoc-server serving '.' http://any:8080 # set cache control max age (7 seconds) $ doc-server -m 7200doc-server serving '.' http://any:8080 # specify ignored files (pdf and swf) $ doc-server --lr-ignore=.pdf --lr-ignore=.swfdoc-server serving '.' http://any:8080 # show help message, including all options $ doc-server -h
Contribution and License Agreement
If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license. You are also implicitly verifying that all code is your original work.
License
Copyright (c) 2015-2015, Conrado Quilles Gomes. (MIT License)
See LICENSE for more info.