Skip to content

Instantly share code, notes, and snippets.

@parambirs
Created October 20, 2015 11:03
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 parambirs/5e0ad615f0db5c9c47e7 to your computer and use it in GitHub Desktop.
Save parambirs/5e0ad615f0db5c9c47e7 to your computer and use it in GitHub Desktop.
{-# LANGUAGE OverloadedStrings #-}
import Web.Scotty
import Network.HTTP.Types
main = scotty 3000 $ do
get "/" $ do -- handle GET request on "/" URL
text "This was a GET request!" -- send 'text/plain' response
delete "/" $ do
html "This was a DELETE request!" -- send 'text/html' response
post "/" $ do
text "This was a POST request!"
put "/" $ do
text "This was a PUT request!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment