Safe Haskell | None |
---|
CRUD for JSON data with Redis storage.
Can be used as Backbone.sync backend.
- data Redson b
- redsonInit :: Lens b (Snaplet (AuthManager b)) -> SnapletInit b (Redson b)
Documentation
redsonInit :: Lens b (Snaplet (AuthManager b)) -> SnapletInit b (Redson b)Source
Initialize Redson. AuthManager from parent snaplet is required.
Connect to Redis, read configuration and set routes.
appInit :: SnapletInit MyApp MyApp appInit = makeSnaplet "app" "App with Redson" Nothing $ do r <- nestSnaplet "_" redson $ redsonInit auth s <- nestSnaplet "session" session $ initCookieSessionManager sesKey "_session" sessionTimeout a <- nestSnaplet "auth" auth $ initJsonFileAuthManager defAuthSettings return $ MyApp r s a