scotty: Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:

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

{-# LANGUAGE OverloadedStrings #-}

import Web.Scotty

main = scotty 3000 $
  get "/:word" $ do
    beam <- pathParam "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, 0.11.1, 0.11.2, 0.11.3, 0.11.4, 0.11.5, 0.11.6, 0.12, 0.12.1, 0.20, 0.20.1, 0.21, 0.22, 0.30, 0.30
Change log changelog.md
Dependencies aeson (>=0.6.2.1 && <2.3), base (>=4.14 && <5), blaze-builder (>=0.3.3.0 && <0.5), bytestring (>=0.10.0.2), case-insensitive (>=1.0.0.1 && <1.3), containers (>=0.5 && <0.8), cookie (>=0.4), exceptions (>=0.7 && <0.11), fail, http-api-data (<0.7), http-types (>=0.9.1 && <0.13), monad-control (>=1.0.0.3 && <1.1), mtl (>=2.1.2 && <2.4), nats (>=0.1 && <2), network (>=2.6.0.2 && <3.3), random (>=1.0.0.0), regex-compat (>=0.95.1 && <0.96), resourcet, stm, text (>=0.11.3.1), time (>=1.8), transformers (>=0.3.0.0 && <0.7), transformers-base (>=0.4.1 && <0.5), unliftio (>=0.2), unordered-containers (>=0.2.10.0 && <0.3), wai (>=3.0.0 && <3.3), wai-extra (>=3.1.14), warp (>=3.0.13) [details]
License BSD-3-Clause
Copyright (c) 2012-Present, Andrew Farmer and the Scotty contributors
Author Andrew Farmer <xichekolas@gmail.com>
Maintainer The Scotty maintainers
Category Web
Home page https://github.com/scotty-web/scotty
Bug tracker https://github.com/scotty-web/scotty/issues
Source repo head: git clone git://github.com/scotty-web/scotty.git
Uploaded by ocramz at 2026-01-07T07:16:26Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for scotty-0.30

[back to package description]

Scotty Hackage Stackage Lts Stackage Nightly CI

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

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

main = scotty 3000 $
    get "/:word" $ do
        beam <- pathParam "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.

Examples

Run /basic.hs to see Scotty in action:

runghc examples/basic.hs

Setting phasers to stun... (port 3000) (ctrl-c to quit)

Or equivalently with stack:

stack exec -- scotty-basic

Once the server is running you can interact with it with curl or a browser:

curl localhost:3000

foobar

curl localhost:3000/foo_query?p=42

<h1>42</h1>

Additionally, the examples directory shows a number of concrete use cases, e.g.

More Information

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

Contributing

Feel free to ask questions or report bugs on the Github issue tracker.

Github issues are now (September 2023) labeled, so newcomers to the Haskell language can start with easy fix ones and gradually progress to new features, bugs and R&D :)

Package versions

Scotty adheres to the Package Versioning Policy.

FAQ

Contributors

Copyright

(c) 2012-Present, Andrew Farmer and Scotty contributors