Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hph/butler
A static file server
https://github.com/hph/butler
server static static-server
Last synced: 2 months ago
JSON representation
A static file server
- Host: GitHub
- URL: https://github.com/hph/butler
- Owner: hph
- License: mit
- Created: 2016-10-09T16:51:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-06T12:38:08.000Z (over 7 years ago)
- Last Synced: 2024-10-13T07:17:09.275Z (3 months ago)
- Topics: server, static, static-server
- Language: TypeScript
- Homepage:
- Size: 49.8 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Butler
[![Package Version](https://img.shields.io/npm/v/butler-server.svg)](https://www.npmjs.com/package/butler-server)
[![License](https://img.shields.io/npm/l/butler-server.svg)](https://tldrlegal.com/license/mit-license)> A static file server written in TypeScript.
## Usage
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).## Advanced options
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.## Install
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`.