Skip to content

Instantly share code, notes, and snippets.

@markdcummings
Created April 4, 2015 04:06
Show Gist options
  • Save markdcummings/16982872a87f06822d67 to your computer and use it in GitHub Desktop.
Save markdcummings/16982872a87f06822d67 to your computer and use it in GitHub Desktop.
-- Simple web server using spock (http://www.spock.li/), a Sinatra-esque web
-- framework for Haskell.
--
-- https://hackage.haskell.org/package/Spock
-- https://github.com/agrafix/Spock
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Monoid
import Web.Spock.Safe
main :: IO ()
main =
runSpock 8080 $ spockT id $
do get root $
text "Hello World!"
get ("vulcan-salute" <//> var) $ \name ->
text ("dif tor heh smusma " <> name <> "!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment