Skip to content

Instantly share code, notes, and snippets.

@potomak
Created December 13, 2016 05:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save potomak/f779c6814e7213215be19256231e4efa to your computer and use it in GitHub Desktop.
Save potomak/f779c6814e7213215be19256231e4efa to your computer and use it in GitHub Desktop.
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