Source

haskellblog / src / BlogCgi.hs

Full commit
Luke Plant 720add2 
Luke Plant 3717fda 
Luke Plant fbbb971 
Luke Plant 5db85a6 
Luke Plant a995aee 
Luke Plant cf0f633 
Luke Plant a995aee 
Luke Plant 5db85a6 
Luke Plant 3717fda 
Luke Plant fbbb971 


Luke Plant 720add2 
Luke Plant 1791a06 
Luke Plant 5db85a6 

Luke Plant 1791a06 
Luke Plant 5db85a6 
import Blog.Routes (views)
import Blog.Views (return404)
import Blog.Globals (csrfProtectionProcessor)
import Database.HDBC
import Ella.Framework
import Ella.Processors.Security (signedCookiesProcessor)
import qualified Blog.Settings as Settings

options = defaultDispatchOptions { notFoundHandler = return404
                                 , viewProcessors = [ signedCookiesProcessor Settings.secret
                                                    , csrfProtectionProcessor
                                                    ]
                                 }

sqlDebug action = catchSql (do { action; return ()}) (\e -> sendResponseCGI $ default500 $ show e)

main :: IO ()
main = sqlDebug $ dispatchCGI views options