Created
December 13, 2016 05:48
-
-
Save potomak/f779c6814e7213215be19256231e4efa 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
main :: IO () | |
main = scotty 8080 $ do | |
get "/hello" $ do | |
let content = "Hello world!" | |
respondTo $ do | |
formatJson $ | |
json $ object ["content" .= content] | |
formatText $ | |
text content | |
format "application/vnd.chess-pgn" $ do | |
setHeader "Content-Type" "application/vnd.chess-pgn; charset=utf-8" | |
raw $ encodeUtf8 "1. e4" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment