Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (10 sloc) 299 Bytes
import Network.Loli
import Hack.Handler.SimpleServer
import Maybe
import System.Environment
main = do
port <- getEnv "PORT"
run (fromIntegral $ read port) . loli $ do
get "/echo/:user" $ do
text . ("Hi, " ++) . fromJust . lookup "user" =<< captures
get "/" (text "hello world")
Something went wrong with that request. Please try again.