Created
January 19, 2015 13:03
-
-
Save Elzair/abd31fbbfe1abf5eb72e to your computer and use it in GitHub Desktop.
sample-scotty-app
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 Data.Monoid (mconcat) | |
import Network.Wai.Middleware.Static | |
import Web.Scotty | |
main = scotty 3000 $ do | |
middleware $ staticPolicy (noDots >-> addBase "static") | |
get "/" $ file "static/index.html" | |
get "/:word" $ do | |
beam <- param "word" | |
html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment