10 releases (5 breaking)

Uses new Rust 2021

0.5.0 Jan 16, 2022
0.4.0 Nov 28, 2021
0.3.0 Aug 30, 2021
0.2.0 Jun 27, 2021
0.1.0 Nov 10, 2020

#123 in HTTP server

Download history 4/week @ 2022-01-24 1/week @ 2022-01-31 10/week @ 2022-02-21 1/week @ 2022-03-07 41/week @ 2022-03-14 31/week @ 2022-03-21 1/week @ 2022-03-28 3/week @ 2022-04-04 62/week @ 2022-04-25 73/week @ 2022-05-02 11/week @ 2022-05-09

146 downloads per month

GPL-3.0 license

205KB
5K SLoC

Operator

Operator is a web server. You provide a directory and Operator serves it over HTTP.

It serves static files the way you'd expect, but it can also serve dynamic content that is generated at request time by handlebars templates or executables.

More information is available on the Operator website.

Installation

Operator is a single self-contained binary. You can download a build from the releases list, unzip it, and run it from any working directory.

Usage

The CLI has three subcommands:

  1. eval evaluates a handlebars template from STDIN.
  2. get renders content from a content directory.
  3. serve starts an HTTP server.

serve is where the real action is, but the other two come in handy at times.

These commands all require a content directory, which is just the folder where your website lives. There are a bunch of sample content directories in samples/.

To learn more, run operator --help or operator <SUBCOMMAND> --help.

Developer Quick Start

Let's run a server for one of the samples:

git clone git@github.com:mkantor/operator.git
cd operator
cargo run -- -vv serve \
  --content-directory=samples/realistic-advanced \
  --index-route=/home \
  --error-handler-route=/error-handler \
  --bind-to=127.0.0.1:8080

Then open http://localhost:8080 in your browser of choice.

Disclaimer

Operator is very young and has not been battle-hardened. There are known flaws and obvious missing features that need to be addressed. The major ones are filed as issues. All feedback is greatly appreciated.

This is my first nontrivial Rust project and I'm sure there are places where things could be improved. One of the reasons I created Operator was to get more experience with the language, so if you notice anything iffy (no matter how small), please open an issue to help me out! ❤️


Operator

Dependencies

~26MB
~575K SLoC