snaplet-redson-0.1.0.0: CRUD for JSON data with Redis storage

Safe HaskellNone

Snap.Snaplet.Redson

Description

CRUD for JSON data with Redis storage.

Can be used as Backbone.sync backend.

Synopsis

Documentation

data Redson b Source

Redson snaplet state type.

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