diff options
author | Till Hoeppner | 2014-11-30 22:30:32 +0100 |
---|---|---|
committer | Till Hoeppner | 2014-11-30 22:31:17 +0100 |
commit | 7798a8d1132128443cf616eb908dce8affb6e207 (patch) | |
tree | 7b11f8bebddc2618338a383f0f3534c5a65b909e | |
parent | 510d6ef41fb595eb928453ab5a2080d009a03a67 (diff) | |
download | sersve-7798a8d1132128443cf616eb908dce8affb6e207.tar.gz sersve-7798a8d1132128443cf616eb908dce8affb6e207.tar.xz sersve-7798a8d1132128443cf616eb908dce8affb6e207.zip |
More information in README
-rw-r--r-- | README.md | 42 |
1 files changed, 42 insertions, 0 deletions
@@ -2,3 +2,45 @@ sersve [![Build Status](https://travis-ci.org/hoeppnertill/sersve.svg)](https:// ====== A simple directory server. It works for my own purposes so far, but feel free to try or contribute. + +[Relevant blog article.](http://till.hoeppner.ws/2014/11/30/Introducing-sersve-a-directory-server-in-Rust-with-Iron/) + +## Build + +```bash +git clone https://github.com/hoeppnertill/sersve.git +cd sersve +cargo build --release # leave off --release if impatient +target/release/sersve # target/sersve respectively +# You can now visit `localhost:8080` in a browser +``` + +## Options + +``` +Usage: target/release/sersve [options] +A minimal directory server, written in Rust with Iron. +Options: + -c --config NAME set config file name + -a --address HOST the address to bind to + -p --port PORT the port to serve + -r --root ROOT the uppermost directory to serve + -f --filter REGEX a regular expression to filter the filenames + -s --size BYTES the maximum size of a file that will be served + -t --template TEMPLATE + a mustache template to use for rendering + -h --help print this help menu +``` + +## Configuration format + +```json +{ + "address": "0.0.0.0", + "port": 8080, + "root": "/home/", + "filter": "^[^\\.]+$", + "template": "<!DOCTYPE html><html><title>{{title}}</title><body><div id=\"container\"><h1>{{title}}</h1><table><thead><tr><th>Name</th><th>Size</th></tr></thead><tbody>{{#content}} <tr> <td> <a href=\"/{{url}}\">{{name}}</a> </td> <td> {{size}} </td> </tr> {{/content}} </tbody> </table> </div> </body></html>", + "size": 10485760 +} +``` |