twain: Tiny web application framework for WAI.

[ bsd3, library, web ] [ Propose Tags ]

Twain is tiny web application framework for WAI. It provides routing, parameter parsing, and a reader-like monad for composing responses from an environment.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 1.0.0.0, 2.0.0.0, 2.0.1.0, 2.1.0.0, 2.1.2.0
Change log changelog.md
Dependencies aeson (>=1.4 && <1.7), base (>=4.7 && <5), bytestring (>=0.10 && <0.11), case-insensitive (>=1.2 && <1.3), cookie (>=0.4 && <0.6), either (>=5.0 && <5.1), http-types (>=0.12 && <0.13), text (>=1.2.3 && <1.3), time (>=1.8 && <1.9.9), transformers (>=0.5.6 && <0.6), wai (>=3.2 && <3.3), wai-extra (>=3.0 && <3.2), warp (>=3.2 && <3.4) [details]
License BSD-3-Clause
Copyright 2021 Alexander C. Mingoia
Author Alex Mingoia
Maintainer alex@alexmingoia.com
Category Web
Home page https://github.com/alexmingoia/twain#readme
Bug tracker https://github.com/alexmingoia/twain/issues
Source repo head: git clone https://github.com/alexmingoia/twain
Uploaded by alexmingoia at 2021-05-11T10:20:45Z
Distributions NixOS:2.1.2.0
Downloads 742 total (39 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2021-05-11 [all 1 reports]

Readme for twain-1.0.0.0

[back to package description]

Twain

Hackage BSD3 License

Twain is a tiny web application framework for WAI.

  • Simple routing with path captures.
  • Parameter parsing of cookies, path, query, and body.
  • Compose responses from an app environment using a reader-like monad.
  • Helpers for redirects, headers, status codes.
  • Routes decompose into WAI middleware.
import Web.Twain

main :: IO ()
main = do
  twain 8080 "my app" $ do
    get "/" $ do
      send $ html "Hello, World!"