A static file server written in TypeScript.
From within any directory, simply run Butler in the terminal:
butler
A server will be launched on port localhost:8080
, listing all directories and
files in the current directory. Directories containing an index.html
file
will automatically render them instead of listing files. You can also provide a
directory name as an argument when running butler
in order to serve files
from that directory (as opposed to the current working directory).
You may provide one or more options when running butler
.
--port
Specify the port from which to serve (default: 8080).--base-path
Specify the base URL from which to serve (default:/
). pecifying a leading and trailing slash is optional but they will be added automatically. In addition, a redirect is set up in order to direct all requests that lack the base path to the correct URL.--force-tls
Only allow secure requests.
You must install Butler globally:
yarn global add butler-server # Or npm install -g butler-server
Note that the correct NPM package name is butler-server
, not butler
.