webapp: Haskell web app framework based on WAI & Warp

[ library, mit, web ] [ Propose Tags ]

See README.md


[Skip to Readme]
Versions [faq] 0.0.1, 0.0.2, 0.1.0, 0.1.1, 0.1.2, 0.2.0, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.3.6, 0.4.0, 0.4.1, 0.5.0, 0.6.0, 0.6.1 (info)
Change log CHANGELOG.md
Dependencies aeson, base (>=4.8.0.0 && <=4.8.1.0), base16-bytestring, blaze-builder, bytestring, case-insensitive, http-types, mtl, network, optparse-applicative, regex-posix, stm, streaming-commons, text, transformers, unix, wai, warp, warp-tls, zlib [details]
License MIT
Copyright (c) 2015 Nathaniel Symer
Author Nathaniel Symer <nate@symer.io>
Maintainer Nathaniel Symer <nate@symer.io>
Category Web
Home page https://github.com/fhsjaagshs/webapp
Bug tracker https://github.com/fhsjaagshs/webapp/issues
Source repo head: git clone git://github.com/fhsjaagshs/webapp.git
Uploaded by natesymer at Mon Jan 18 21:08:41 UTC 2016
Distributions NixOS:0.6.1
Downloads 4223 total (165 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
Last success reported on 2016-01-20 [all 3 reports]

Modules

  • Web
    • Web.App
      • Web.App.HTTP
      • Internal
        • Web.App.Internal.TerminalSize
      • Web.App.Main
      • Web.App.Middleware
        • Web.App.Middleware.ForceSSL
        • Web.App.Middleware.Gzip
      • Web.App.Parameter
      • Web.App.Path
      • Web.App.RouteT
      • Web.App.State
      • Web.App.Stream
      • Web.App.WebApp

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for webapp-0.2.0

[back to package description]

webapp - WAI web framework

Webapp is a web framework that is designed to provide everything needed to define & deploy a web app.

Basic example:

module Main where

import Web.App
import qualified Control.Monad.State.Class as S

instance WebAppState Integer where
  initState = return 0
  destroyState st = do
    putStr "Counted: "
    print st

main = webappMainIO' app "My Web App"

app :: WebAppT Integer IO ()
app = do
  get "/" $ do
    addHeader "Content-Type" "text/plain"
    S.get >>= writeBody . show

  get "/add" $ do
    S.state (((),) . (+) 1)
    redirect "/"
    
  get "/subtract" $ do
    S.get >>= S.put . ((-) 1)
    redirect "/"