Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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`.