Skip to content

Instantly share code, notes, and snippets.

@corruptmemory
Created January 14, 2012 03:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corruptmemory/1610096 to your computer and use it in GitHub Desktop.
Save corruptmemory/1610096 to your computer and use it in GitHub Desktop.
Yesod/Haskell PONG
{-# LANGUAGE OverloadedStrings, QuasiQuotes, TypeFamilies, TemplateHaskell, MultiParamTypeClasses #-}
import Yesod.Dispatch
import Yesod.Core
import Yesod.Content
import Data.ByteString (ByteString)
import Network.Wai.Handler.Warp (run)
data Pong = Pong
mkYesod "Pong" [$parseRoutes|
/ PongR GET
|]
instance Yesod Pong where
approot _ = ""
encryptKey _ = return Nothing
getPongR = return $ RepPlain $ toContent ("PONG" :: ByteString)
main = toWaiAppPlain Pong >>= run 3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment