| Crates.io | scratchpost |
| lib.rs | scratchpost |
| version | 0.1.1 |
| created_at | 2025-05-26 18:17:19.332864+00 |
| updated_at | 2025-05-27 04:48:09.650444+00 |
| description | A simple key/value cache server built in Rust. |
| homepage | |
| repository | https://github.com/IronstoneInnovation/scratchpost |
| max_upload_size | |
| id | 1690108 |
| size | 1,685,314 |

A simple key/value cache server built in Rust.
Install scratchpost with cargo:
$ cargo install scratchpost
There's only one setting available currently, the maximum size of the cache. This is controlled by setting the SCRATCHPOST_MAX_ITEMS environment variable; if this is not set the default value of 1000 is used.
Start scratchpost:
$ scratchpost
When launch Rocket will print the following (your port number may differ):
Rocket has launched from http://127.0.0.1:8000
GET /Returns http status 200 and the message "Feed me!".
POST /itemStores an item (key/value pair) in the cache. The item is included in the request body as a JSON object, like this:
{
"key": "string",
"value": "string"
}
Note that an empty string value will not be accepted and status 400 will be returned.
If successful, http status 200 is returned.
GET /item/<key>Retrieves the value of an item from the cache. If the item does not exist an empty string is returned.
MIT