Add Y.Default.Handlers
* Provides the standard getFaviconR and getRobotsR
This commit is contained in:
parent
affeaee3f7
commit
28e9a1f235
14
yesod-default/Yesod/Default/Handlers.hs
Normal file
14
yesod-default/Yesod/Default/Handlers.hs
Normal file
@ -0,0 +1,14 @@
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
module Yesod.Default.Handlers
|
||||
( getFaviconR
|
||||
, getRobotsR
|
||||
) where
|
||||
|
||||
import Yesod.Handler (GHandler, sendFile)
|
||||
import Yesod.Content (RepPlain(..), ToContent(..))
|
||||
|
||||
getFaviconR :: GHandler s m ()
|
||||
getFaviconR = sendFile "image/x-icon" "config/favicon.ico"
|
||||
|
||||
getRobotsR :: GHandler s m RepPlain
|
||||
getRobotsR = return $ RepPlain $ toContent ("User-agent: *" :: String)
|
||||
@ -37,6 +37,7 @@ library
|
||||
exposed-modules: Yesod.Default.Config
|
||||
, Yesod.Default.Main
|
||||
, Yesod.Default.Util
|
||||
, Yesod.Default.Handlers
|
||||
|
||||
ghc-options: -Wall
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user