Skip to content

Instantly share code, notes, and snippets.

@joseph-montanez
Created August 5, 2011 20:25
Show Gist options
  • Save joseph-montanez/1128434 to your computer and use it in GitHub Desktop.
Save joseph-montanez/1128434 to your computer and use it in GitHub Desktop.
Delayed
ghc -XPackageImports pong.hs
{-# LANGUAGE OverloadedStrings #-}
module Main where
import System
import Control.Applicative
import "monads-fd" Control.Monad.Trans
import Snap.Http.Server
import Snap.Iteratee
import Snap.Types
import Snap.Util.FileServe
import qualified Control.Concurrent as T
site :: Snap ()
site = do
liftIO (T.threadDelay $ 1000000 * 5)
writeBS "PONG"
main :: IO ()
main = do
args <- getArgs
let port = case args of
[] -> 3000
p:_ -> read p
config = setPort port $
setAccessLog Nothing $
defaultConfig
httpServe config site
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment