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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?