From 5e3e83f50c86a7c8d2776f848efbf653088e7581 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 17 Feb 2017 22:13:36 +0000 Subject: [PATCH] Update readme --- README.md | 48 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index cf21fe4..91cd599 100644 --- a/README.md +++ b/README.md @@ -2,29 +2,55 @@ The only static-file server you'll ever need! ### Features: -- Logging -- Basic-Auth _(optional)_ +- Logging - [`winston`](https://www.npmjs.com/package/winston) +- Basic-Auth - [`basic-auth`](https://www.npmjs.com/package/basic-auth) - Custom 404 page - Optimum Compression - [`compression`](https://www.npmjs.com/package/compression) - Security checks / headers - [`helmet`](https://www.npmjs.com/package/helmet) - Opbeat error-reporting - [docs](https://opbeat.com/docs/articles/get-started-with-express/) +- Whitelist IP Addresses - [`express-ip-access-control`](https://www.npmjs.com/package/express-ip-access-control) +- Directory Listing - [`serve-index`](https://www.npmjs.com/package/serve-index) -### Usage / Configuration +### Usage ```bash -tstatic + tstatic [options] + + -h --help Show this screen. + --version Show version. + -p --port= Port to listen on. + -b --basic-auth= Enable basic-auth. + -i --ips= Allowed IP addresses. + -l --list-dir List Directory. + --opbeat Enable Opbeat. + -o --open Open in browser after start. + ``` -`directory` is where your static files are. +`dir` is where your static files are. -404 errors will return with `/.404.html`, with status code 404. If this file doesnt exist, plain error page will be shown. +404 errors will return with `/.404.html`, with status code 404. If this file doesnt exist, the default error page will be shown. -#### Environment -Make sure to set `NODE_ENV` to `production`! +### Configuration -`PORT`: The port you want the server to listen on. Default: `5000`. +##### `port` +The port for the server to listen on. Currently supports plain HTTP only -`BASIC_AUTH_USERNAME` / `BASIC_AUTH_PASSWORD`: Credentials for built-in basic auth +##### `basic-auth` +Enable basic-auth for all paths. Currently only supports single credentals. -Opbeat middleware is configured using documented variables [here](https://opbeat.com/docs/articles/opbeat-for-nodejs-api/#appid). _Requires production `NODE_ENV`!_ +Format:`-b username:password` +##### `ips` +IP addresses that are allowed to connect to the server. + +Format: `-i 192.168.1.100,192.168.1.101` + +##### `list-dir` +Enables directory listing. Allow browseing + +##### `opbeat` +Enable opbeat error reporting. `--opbeat` only enables this, configuration is done using [environment varables](https://opbeat.com/docs/articles/get-started-with-express/#appId). + +##### `open` +Open the server in the browser one started. It will open in your default browser, and use url `http://0.0.0.0:`.