The scotty package

[ Tags: bsd3, library, web ] [ Propose Tags ]

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.

As for the name: Sinatra + Warp = Scotty.

WAI
http://hackage.haskell.org/package/wai
Warp
http://hackage.haskell.org/package/warp

[Skip to Readme]

Properties

Versions 0.0.1, 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.4.5, 0.4.6, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.8.1, 0.8.2, 0.9.0, 0.9.1, 0.10.0, 0.10.1, 0.10.2, 0.11.0 (info)
Change log changelog.md
Dependencies aeson (>=0.6.2.1 && <1.3), base (>=4.3.1 && <5), blaze-builder (>=0.3.3.0 && <0.5), bytestring (>=0.10.0.2 && <0.11), case-insensitive (>=1.0.0.1 && <1.3), data-default-class (>=0.0.1 && <0.2), fail, http-types (>=0.8.2 && <0.11), monad-control (>=1.0.0.3 && <1.1), mtl (>=2.1.2 && <2.3), nats (>=0.1 && <2), network (>=2.6.0.2 && <2.7), regex-compat (>=0.95.1 && <0.96), text (>=0.11.3.1 && <1.3), transformers (>=0.3.0.0 && <0.6), transformers-base (>=0.4.1 && <0.5), transformers-compat (>=0.4 && <0.6), wai (>=3.0.0 && <3.3), wai-extra (>=3.0.0 && <3.1), warp (>=3.0.0 && <3.3) [details]
License BSD3
Copyright (c) 2012-Present Andrew Farmer
Author Andrew Farmer <xichekolas@gmail.com>
Maintainer Andrew Farmer <xichekolas@gmail.com>
Category Web
Home page https://github.com/scotty-web/scotty
Bug tracker https://github.com/scotty-web/scotty/issues
Source repository head: git clone git://github.com/scotty-web/scotty.git
Uploaded Tue Jan 26 06:06:01 UTC 2016 by AndrewFarmer
Updated Sun Oct 22 14:33:13 UTC 2017 by ryanglscott to revision 6
Distributions Fedora:0.11.0, LTSHaskell:0.11.0, NixOS:0.11.0, Stackage:0.11.0, Tumbleweed:0.11.0
Downloads 23847 total (227 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-11-21 [all 2 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees


Readme for scotty-0.11.0

[back to package description]

Scotty Build StatusCoverage Status

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.

More Information

Tutorials and related projects can be found in the Scotty wiki:

https://github.com/scotty-web/scotty/wiki

Development & Support

Open an issue on GitHub or join #scotty on Freenode.

Copyright (c) 2012-2014 Andrew Farmer