1{-# LANGUAGE QuasiQuotes, TypeFamilies, GeneralizedNewtypeDeriving #-}
2{-# LANGUAGE OverloadedStrings #-}
3module TestApp (testApp) where
6import Data.ByteString.Lazy.Char8 (pack)
7import Database.Persist.Sqlite
9import Control.Monad (when)
17 putStrLn "testApp called, this should happen only once per reload"
19 -- Swap between the following two lines as necessary to generate errors
20 exi <- doesFileExist db
22 when exi $ removeFile db
23 withSqlitePool db 10 $ \pool -> do
24 flip runSqlPool pool $ runMigration $ migrate $ Dummy ""
26 if pathInfo req == "/favicon.ico"
27 then return $ Response status301 [("Location", "http://docs.yesodweb.com/favicon.ico")]
28 $ ResponseLBS $ pack ""
31 x <- flip runSqlPool pool $ do
33 count ([] :: [Filter Dummy])
34 return $ Response status200
35 [("Content-Type", "text/plain; charset=utf-8")]
36 $ ResponseLBS $ pack $ "Counter: " ++ show x
37 putStrLn "handler completed, this should only happen at the beginning of a reload"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list