https://github.com/luzifer/restis
"restis", composed from "REST" and "Redis", is a simple HTTP API to get / set / delete Redis keys
https://github.com/luzifer/restis
api http redis rest
Last synced: 7 months ago
JSON representation
"restis", composed from "REST" and "Redis", is a simple HTTP API to get / set / delete Redis keys
- Host: GitHub
- URL: https://github.com/luzifer/restis
- Owner: Luzifer
- License: apache-2.0
- Created: 2022-12-27T17:13:01.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-28T13:36:47.000Z (over 3 years ago)
- Last Synced: 2025-08-01T00:30:22.375Z (8 months ago)
- Topics: api, http, redis, rest
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE
Awesome Lists containing this project
README
# Luzifer / restis
`restis`, composed from `REST` and `Redis`, is a simple HTTP API to get / set / delete Redis keys.
## Q&A
- **Why?**
Previously I used a kyototycoon to store simple key-value-data through a REST interface but needed something not using a proprietary database format below it to have it running statelessly in a cluster. Searching for some alternative I gave up and invested 20 minutes in putting together this.
- **Is there any security built in?**
No. And it never will be. Don't expose it without securing it for example using [nginx-sso](https://github.com/Luzifer/nginx-sso) or Gatekeeper or whatever. This is just a simple API, you're responsible for the rest.
## Usage
```console
# restis --help
Usage of ./restis:
--disable-cors Disable setting CORS headers for all requests
--listen string Port/IP to listen on (default ":3000")
--log-level string Log level (debug, info, warn, error, fatal) (default "info")
--redis-conn-string string Connection string for redis (default "redis://localhost:6379/0")
--redis-key-prefix string Prefix to prepend to keys (will be prepended without delimiter!)
--version Prints current version and exits
```
```console
# curl -fX GET localhost:3000/mykey
curl: (22) The requested URL returned error: 404
# echo "mycontent" | curl -fX PUT --data-binary @- localhost:3000/mykey
# curl -fX GET localhost:3000/mykey
mycontent
# curl -fX DELETE localhost:3000/mykey
# curl -fX GET localhost:3000/mykey
curl: (22) The requested URL returned error: 404
# echo "mycontent" | curl -fX PUT --data-binary @- localhost:3000/mykey\?expire=30s
# curl -fX GET localhost:3000/mykey
mycontent
# sleep 30; curl -fX GET localhost:3000/mykey
curl: (22) The requested URL returned error: 404
```