wheb-redis

Redis connection for Wheb

https://github.com/hansonkd/Wheb-Framework

Latest on Hackage:0.0.1.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD-3-Clause licensed by Kyle
Maintained by [email protected]

Implements basic functionality for:

Gives instances of Auth, Session and Cache backends for Wheb.

In action:

Use with language extensions OverloadedStrings

 import Web.Wheb
 import Web.Wheb.Plugins.Redis

 data MyCtx = MyCtx RedisContainer

 instance RedisApp MyCtx where
   getRedisContainer (MyCtx rc) = rc

 main :: IO ()
 main = do
   opts <- generateOptions $ do
       r <- initRedis defaultConnectInfo
       addGET "home" rootPat ((runRedis $ get "hello") >>= (text . spack))
       return (MyCtx r, ())

   runRawHandler opts $ do
       runRedis $ set "hello" "world"

   runWhebServer opts