Skip to content

Latest commit

 

History

History
65 lines (39 loc) · 1.58 KB

README.md

File metadata and controls

65 lines (39 loc) · 1.58 KB

GitHub issues CircleCI

RedisREST

Extension modules to Redis' native data types and commands

Getting started

cargo +nightly build --release
redis-server --loadmodule ./target/release/libredisrest.so

Note: Redis REST Module uses Rocket web frameworks that must be build using nightly version of Rust.

Using the Redis REST module

Let's get, set and delete key in Redis:

curl -X GET http://localhost:8000/set/foo/bar

curl -X GET http://localhost:8000/get/foo

curl -X GET http://localhost:8000/del/foo

Increment a value

curl -X GET http://localhost:8000/set/num/1

curl -X GET http://localhost:8000/get/num

curl -X GET http://localhost:8000/incr/num

curl -X GET http://localhost:8000/get/num

Set and get a hash

curl -X GET http://localhost:8000/hset/hfoo/key1/val1/key2/val2

curl -X GET http://localhost:8000/hgetall/hfoo

curl -X GET http://localhost:8000/hmset/hfoo/key1/new_value1

curl -X GET http://localhost:8000/hgetall/hfoo

You have the pattern...

Enjoy!

Configuring Web Server

see: https://rocket.rs/v0.4/guide/configuration/

For example:

ROCKET_ENV=production ROCKET_PORT=8080 redis-server --loadmodule ./target/release/libredisrest.so