Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
This is no longer the official repository. See:
Branch: master
Pull request Compare This branch is 179 commits behind scotty-web:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Network/Wai/Middleware Fix wai-middleware-static for Wai 2.0
Web Update haddock
examples Cleanup of examples, and new cookie example.
wai-middleware-static Fix wai-middleware-static for Wai 2.0
.gitignore GZip example
LICENSE
Makefile
README.md Markdown readme
ReleaseNotes.md Add paren
Setup.hs
scotty.cabal Edit repo URLs

README.md

Scotty

A Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp.

{-# LANGUAGE OverloadedStrings #-}
import Web.Scotty

import Data.Monoid (mconcat)

main = scotty 3000 $ do
get "/:word" $ do
  beam <- param "word"
  html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"]

Scotty is the cheap and cheerful way to write RESTful, declarative web applications.

  • A page is as simple as defining the verb, url pattern, and Text content.
  • It is template-language agnostic. Anything that returns a Text value will do.
  • Conforms to WAI Application interface.
  • Uses very fast Warp webserver by default.

See examples/basic.hs to see Scotty in action. (basic.hs needs the wai-extra package)

> runghc examples/basic.hs
Setting phasers to stun... (port 3000) (ctrl-c to quit)
(visit localhost:3000/somepath)

As for the name: Sinatra + Warp = Scotty.

Copyright (c) 2012-2013 Andrew Farmer

Something went wrong with that request. Please try again.