Easily add Redis to your Kemal application.
Add this to your application's shard.yml
:
dependencies:
kemal-redis:
github: sdogruyol/kemal-redis
require "kemal"
require "kemal-redis"
redis_connect # With default host and port
# Make sure to yield `env`.
get "/" do |env|
redis.set("foo", "bar")
foo = redis.get("foo")
"Value of foo - #{foo}"
end
You can specify different host and port like below
redis_connect host: "177.11.22.33", port: 8801
To check more examples of Redis see crystal-redis-example.
- Fork it ( https://github.com/sdogruyol/kemal-redis/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- sdogruyol Sdogruyol - creator, maintainer