Created
October 20, 2015 11:03
-
-
Save parambirs/5e0ad615f0db5c9c47e7 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 #-} | |
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