Skip to content

agnosticeng/http-temp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

http-temp-server

A lightweight HTTP key-value store. PUT or POST any content to a path; GET it back until it expires.

Usage

cargo run

Routes

Method Path Description
PUT / POST /*path Store the request body. Respects Content-Type. Returns 204.
GET /*path Retrieve stored content with its original Content-Type. Returns 200 or 404.
curl -X PUT http://localhost:9090/hello -H "Content-Type: text/plain" -d "world"
curl http://localhost:9090/hello
# → world

Configuration

Settings are loaded in order (last wins): built-in defaults → config.tomlAPP_* env vars.

Key Default Description
bind 127.0.0.1:9090 Address and port to listen on
ttl_seconds 300 Time before a cached entry expires
max_cache_size 1000 Maximum number of entries in the cache
APP_BIND=0.0.0.0:8080 APP_TTL_SECONDS=60 cargo run

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages