@hackage apiary0.3.2.0

Simple web framework inspired by scotty.

Simple web framework inspired by scotty.

{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE OverloadedStrings #-}

import Web.Apiary
import Network.Wai.Handler.Warp
import qualified Data.ByteString.Lazy.Char8 as L

main :: IO ()
main = run 3000 . runApiary def $ do
  [capture|/:String|] $ do
    stdMethod GET . action $ \name -> do
      contentType "text/html"
      lbs . L.concat $ ["<h1>Hello, ", L.pack name, "!</h1>"]
  • Nestable route handling(ApiaryT Monad; capture, stdMethod and more.).

  • type safe path capture.

full example & tutorial: https://github.com/philopon/apiary/blob/master/examples/main.lhs

  • Installation

  • Dependencies (0)

  • Dependents (0)