A simple key/value cache server built in Rust.
Install scratchpost with cargo:
$ cargo install scratchpostThere'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:
$ scratchpostWhen launch Rocket will print the following (your port number may differ):
Rocket has launched from http://127.0.0.1:8000
Returns http status 200 and the message "Feed me!".
Stores 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.
Retrieves the value of an item from the cache. If the item does not exist an empty string is returned.
MIT
