The only static-file server you'll ever need!tstatic
The only static-file server you'll ever need!
- Basic-Auth -
- Custom 404 page
- Optimum Compression -
- Security checks / headers -
- Whitelist IP Addresses -
- Directory Listing -
tstatic <dir> [options] -h --help Show this screen. --version Show version. -p <port> --port=<port> Port to listen on. -b <auth> --basic-auth=<auth> Enable basic-auth. -i <ips> --ips=<ips> Allowed IP addresses. -l --list-dir List Directory. -o --open Open in browser after start.
diris where your static files are.
404 errors will return with
<dir>/.404.html, with status code 404. If this file doesnt exist, the default error page will be shown.
The port for the server to listen on. Currently supports plain HTTP only
Enable basic-auth for all paths. Currently only supports single credentals.
IP addresses that are allowed to connect to the server.
Enables directory listing. Allow browseing
Open the server in the browser one started. It will open in your default browser, and use url
Included in this repo is a
Dockerfileto use. The default setup requires being run from the project directory, and will serve
/publicin the container on port
5000. By default, this directory is empty, however can be overriden.
Below is an example
docker-compose.ymlfile you can use with it:
version: "2" services: tstatic: image: "tstatic" build: context: . dockerfile: Dockerfile volumes: - ./site/:/public ports: - "5000:5000"
tstaticisn't installed into the path, so run it using
npm start --