Created
December 7, 2011 19:02
-
-
Save qrilka/1444135 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Yesod.Core | |
import Yesod.Content | |
import Data.ByteString (ByteString) | |
import Network.Wai.Handler.Warp (run) | |
import System.Posix.Daemonize (CreateDaemon(..), serviced, simpleDaemon) | |
1import qualified Control.Exception as C | |
import System.Posix.Syslog (syslog, Priority(Notice, Warning)) | |
data Pong = Pong | |
mkYesod "Pong" [$parseRoutes| | |
/ PongR GET | |
|] | |
instance Yesod Pong where | |
approot _ = "" | |
encryptKey _ = return Nothing | |
getPongR = return $ RepPlain $ toContent ("PONG" :: ByteString) | |
main = serviced $ simpleDaemon { program = const $ runner | |
, name = Just "yesod" | |
, user = Just "radio" | |
, group = Just "radio"} | |
runner = toWaiAppPlain Pong >>= run 3008 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment