Skip to content

Instantly share code, notes, and snippets.

@Elzair
Created January 19, 2015 13: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 Elzair/abd31fbbfe1abf5eb72e to your computer and use it in GitHub Desktop.
Save Elzair/abd31fbbfe1abf5eb72e to your computer and use it in GitHub Desktop.
sample-scotty-app
{-# 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