kcup
kcup
is a single file server. It responds to every GET
request it receives with the content of a given file (specified by ENV or CLI argument), and for every other request (with any other HTTP method or path) it returns a 404.
kcup
was invented to help with cases where a generally small file needs to be delivered at a certain path, for example MTA STS's /.well-known/mta-sts.txt
. You can read more about this on the associated blog post.
BEWARE This project and repo is so simple (right now) that there aren't even any tests -- I may add some in the future after light use. The machinery (Makefile targets, CI integration, etc) is there for unit, integration and e2e tests, but there just are none.
See also kcup-go
kcup
only needs the path to a single file to run:
console
$ kcup <file path>
By default, kcup
will serve the file at host 127.0.0.1
on port 5000
. kcup
can also take file content from STDIN like so:
```console
$ kcup < your file content
goes here
EOF
``` ```console
kcup 0.1.0 USAGE:
kcup [OPTIONS] FLAGS:
--help Prints help information
-V, --version Prints version information OPTIONS:
-f, --file | ENV variable | Default | Example | Description |
|------------------------------|-------------|----------------------|--------------------------------------------------|
| Keurig created a "K-Cup" brewing system that has become somewhat infamous.
Usage
Environment Variables
HOST
| 127.0.0.1
| 0.0.0.0
| The host on which kcup
will listen |
| PORT
| 5000
| 3000
| The port on whcih kcup
will listen |
| FILE
| N/A | /path/to/your/file
| The path to the file that will be served |
| STDIN_READ_TIMEOUT_SECONDS
| 60
| 10
| The amount of seconds to try and read from STDIN |FAQ
Why is this project named "kcup"?