Created
July 27, 2015 01:54
-
-
Save slogsdon/90894130b7f3dc9b565e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-#LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Data.Monoid | |
import Data.Text (Text, pack) | |
import Web.Spock.Safe | |
main :: IO () | |
main = | |
runSpock 3000 $ spockT id $ | |
do get root $ | |
text "Hello World" | |
get var getPost | |
get ("hello" <//> var) $ \name -> | |
text ("Hello" <> name <> "!") | |
getPost slug = text $ do | |
contents <- readFile $ "./pub/assets/md/" <> slug <> ".md" | |
return $ pack contents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment