serversession/examples/serversession-example-yesod-persistent/Handler/Common.hs
Felipe Lessa 23584a9c47 Add new Yesod+Persistent example, currently just "yesod init".
Separating "yesod init" commit from others in order to be clearer what
changes were made to the scaffold.

[ci skip]
2015-06-01 13:01:23 -03:00

17 lines
528 B
Haskell

-- | Common handler functions.
module Handler.Common where
import Data.FileEmbed (embedFile)
import Import
-- These handlers embed files in the executable at compile time to avoid a
-- runtime dependency, and for efficiency.
getFaviconR :: Handler TypedContent
getFaviconR = return $ TypedContent "image/x-icon"
$ toContent $(embedFile "config/favicon.ico")
getRobotsR :: Handler TypedContent
getRobotsR = return $ TypedContent typePlain
$ toContent $(embedFile "config/robots.txt")