Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (15 sloc) 494 Bytes
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-}
module Main where
import Control.Monad
import Happstack.Server
import System.Environment
handlers :: ServerPart Response
handlers = msum
[ dir "pong" $ ok (toResponseBS "text/plain" "pong")
, serveFile (asContentType "image/png") "FiringGeometry.png"
]
main :: IO ()
main = do
args <- getArgs
let p = if length args == 0 then 8000 else read $ head args
simpleHTTP (nullConf {port = p, logAccess = Nothing}) handlers
Something went wrong with that request. Please try again.