Scotty

受 Ruby 的 Sinatra 启发的 Haskell 网络框架,使用 WAI 和 Warp(官方资源库)。「Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp (Official Repository)」

Github stars Tracking Chart

Scotty Build 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 $
    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 the web application interface (WAI).
  • Uses the 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.

Development & Support

Open an issue on GitHub.

Copyright (c) 2012-2019 Andrew Farmer

Main metrics

Overview
Name With Ownerscotty-web/scotty
Primary LanguageHaskell
Program languageMakefile (Language Count: 2)
Platform
License:BSD 3-Clause "New" or "Revised" License
所有者活动
Created At2011-12-30 22:43:27
Pushed At2025-02-23 11:31:38
Last Commit At2025-02-23 17:01:37
Release Count17
Last Release Name0.12.1 (Posted on )
First Release Name0.7.2 (Posted on )
用户参与
Stargazers Count1.7k
Watchers Count35
Fork Count136
Commits Count549
Has Issues Enabled
Issues Count210
Issue Open Count29
Pull Requests Count152
Pull Requests Open Count4
Pull Requests Close Count45
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private