プロジェクト
GitHubで見る
alexmingoia/twain
概要
Tiny web application framework for WAI.
Web・アプリ開発計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- 0
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルTwain
Twain is a tiny web application framework for WAI.
ResponderMfor composing responses with do notation.- Routing with path captures that decompose
ResponderMinto middleware. - Parameter parsing from cookies, path, query, and body.
- Helpers for redirects, headers, status codes, and errors.
{-# language OverloadedStrings #-}
import Network.Wai.Handler.Warp (run)
import Web.Twain
main :: IO ()
main = do
run 8080 $
foldr ($) (notFound missing) routes
routes :: [Middleware]
routes =
[ get "/" index
, post "/echo/:name" echoName
]
index :: ResponderM a
index = send $ html "Hello World!"
echoName :: ResponderM a
echoName = do
name <- param "name"
send $ html $ "Hello, " <> name
missing :: ResponderM a
missing = send $ html "Not found..."
関連プロジェクトを探す
読み込み中…