Scotty

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

Github星跟踪图

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

主要指标

概览
名称与所有者scotty-web/scotty
主编程语言Haskell
编程语言Makefile (语言数: 2)
平台
许可证BSD 3-Clause "New" or "Revised" License
所有者活动
创建于2011-12-30 22:43:27
推送于2025-02-23 11:31:38
最后一次提交2025-02-23 17:01:37
发布数17
最新版本名称0.12.1 (发布于 )
第一版名称0.7.2 (发布于 )
用户参与
星数1.7k
关注者数35
派生数136
提交数549
已启用问题?
问题数210
打开的问题数29
拉请求数152
打开的拉请求数4
关闭的拉请求数45
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?