Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

This is no longer the official repository. See:

branch: master

This branch is 0 commits ahead and 0 commits behind master

Update haddock

latest commit f7b2fa5bc4
Andrew Farmer authored December 06, 2013
Octocat-spinner-32 Network Fix wai-middleware-static for Wai 2.0 December 05, 2013
Octocat-spinner-32 Web Update haddock December 06, 2013
Octocat-spinner-32 examples Cleanup of examples, and new cookie example. December 06, 2013
Octocat-spinner-32 wai-middleware-static Fix wai-middleware-static for Wai 2.0 December 05, 2013
Octocat-spinner-32 .gitignore GZip example June 02, 2013
Octocat-spinner-32 LICENSE Cabalize January 03, 2012
Octocat-spinner-32 Makefile Add Helpers module October 17, 2013
Octocat-spinner-32 README.md Markdown readme September 18, 2013
Octocat-spinner-32 ReleaseNotes.md Add paren September 19, 2013
Octocat-spinner-32 Setup.hs Cabalize January 03, 2012
Octocat-spinner-32 scotty.cabal Edit repo URLs December 05, 2013
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.