Skip to content

Instantly share code, notes, and snippets.



Created Oct 20, 2015
What would you like to do?
{-# 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