name: Wheb version: 0.0.1.1 synopsis: The Batteries-Included Haskell WAI Framework license: BSD3 license-file: LICENSE author: Kyle Hanson homepage: https://github.com/hansonkd/Wheb-Framework maintainer: hanooter@gmail.com category: Web build-type: Simple cabal-version: >=1.8 description: Wheb aims at providing a simple simple and straightforward web server. . > import Web.Wheb > import Data.Text.Lazy (pack) > > main :: IO () > main = do > opts <- generateOptions $ addGET (pack ".") rootPat $ (text (pack "Hi!")) > runWhebServer (opts :: MinOpts) . Wheb makes it easy to share a global context and handle requests statefully . > > import Control.Concurrent.STM > import Control.Monad.IO.Class > import Data.Monoid > import Data.Text.Lazy (Text, pack) > import Web.Wheb > > data MyApp = MyApp Text (TVar Int) > data MyHandlerData = MyHandlerData Int > > instance Default MyHandlerData where > def = MyHandlerData 0 > > counterMw :: MonadIO m => WhebMiddleware MyApp MyHandlerData m > counterMw = do > (MyApp _ ctr) <- getApp > number <- liftIO $ readTVarIO ctr > liftIO $ atomically $ writeTVar ctr (succ number) > putReqState (MyHandlerData number) > return Nothing > > homePage :: WhebHandler MyApp MyHandlerData > homePage = do > (MyApp appName _) <- getApp > (MyHandlerData num) <- getReqState > html $ ("

Welcome to" <> appName <> > "

You are visitor #" <> (pack $ show num) <> "

") > > main :: IO () > main = do > opts <- generateOptions $ do > startingCounter <- liftIO $ newTVarIO 0 > addWhebMiddleware counterMw > addGET (pack ".") rootPat $ homePage > return $ MyApp "AwesomeApp" startingCounter > runWhebServer opts . Wheb allows you to write robust high concurrency web applications simply and effectively. . * The core datatype will allow you to build anything from a read-only server to a fully interactive web application with hundreds of routes without needing to define MonadTransformers. . * Minimal boilerplate to start your application. . * Plugin system . source-repository head type: git location: git://github.com/hansonkd/Wheb-Framework.git library exposed-modules: Web.Wheb, Web.Wheb.Cookie, Web.Wheb.InitM, Web.Wheb.Internal, Web.Wheb.Routes, Web.Wheb.Types, Web.Wheb.Utils, Web.Wheb.WhebT, Web.Wheb.Plugins.Auth, Web.Wheb.Plugins.Session, Web.Wheb.Plugins.Debug.MemoryBackend build-depends: base ==4.6.*, text ==0.11.*, transformers ==0.3.*, data-default ==0.5.*, wai-extra ==2.0.*, time ==1.4.*, bytestring ==0.10.*, blaze-builder ==0.3.*, cookie ==0.4.*, mtl ==2.1.*, containers ==0.5.*, wai ==2.0.*, http-types ==0.8.*, warp ==2.0.*, conduit ==1.0.*, case-insensitive ==1.0.*, pwstore-fast ==2.4.*, uuid ==1.3.*, stm ==2.4.* GHC-options: -Wall -fno-warn-orphans