summaryrefslogtreecommitdiff
path: root/cattrap/README.md
blob: 4a2cb4104ba0e1b94a5abc50bc20a4a3439fc50c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# cattrap

A wrapper for a simple HTTP server. Will serve the current working directory via HTTP, unless the browser's user agent matches the user-supplied regex: in which case it will serve ascii art of a still frame + lyrics from Rick Astley's hit single, "Never Gonna Give You Up".

## Usage

```bash
[apropos@arch cattrap]$ nimble build --d:release --warnings:off
...
[apropos@arch cattrap]$ ./cattrap
usage: cattrap <port> <regex>
[apropos@arch cattrap]$ ./cattrap 8082 curl
DEBUG Prologue is serving at http://0.0.0.0:8082
DEBUG Starting 1 threads
```

Nim + Nimble are best installed via [choosenim](https://github.com/dom96/choosenim). A Linux x86_64 binary is supplied, however.