Roadrunner
a webserver thats writable both ways :)
Installation
make buildInstall to /usr/local/bin:
make installUsage
./roadrunner --port 8080 --dir .Flags:
--port, -p- Port to listen on (default: 8080)--dir, -d- Directory containing .rdr files (default: current directory)
File Format
Files must end in .rdr and use this structure:
+++
path = /endpoint
writable = true
+++
body contentFront matter fields:
path- URL path (required)writable- Allow POST requests (default: false)password- Require authentication (optional)password_on- Apply password to:none,read,write,both(default: none)
Body is everything after the second +++.
Behavior
GET requests read the file and return the body.
POST requests write the request body to the file if writable = true.
Files can be read/written by external programs. No locking is used. Changes are visible immediately.
Examples
Read-only:
+++
path = /users/1
writable = false
+++
{"id": 1, "name": "John Doe"}Writable:
+++
path = /whiteboard
writable = true
+++
Initial messagePassword protected:
+++
path = /secret
writable = true
password = mysecret123
password_on = both
+++
Protected contentAccess protected endpoints:
curl -H "Authorization: mysecret123" http://localhost:8080/secret
curl -X POST -H "Authorization: mysecret123" http://localhost:8080/secret -d "data"License
AGPL-3.0