The latest version of apiary is 2.1.2-1.
apiary
Version 0.15.2 revision 0 uploaded by HirotomoMoriwaki.
Package meta
- Synopsis
- Simple and type safe web framework that can be automatically generate API documentation.
- Description
Simple and type safe web framework that can be automatically generate API documentation.
{-# 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|/:Int|] . ("name" =: pLazyByteString) . method GET . action $ \age name -> do guard (age >= 18) contentType "text/html" mapM_ lazyBytes ["<h1>Hello, ", name, "!</h1>\n"]
$ curl localhost:3000 404 Page Notfound. $ curl 'localhost:3000/20?name=arice' <h1>Hello, arice!</h1> $ curl 'localhost:3000/15?name=bob' 404 Page Notfound. $ curl -XPOST 'localhost:3000/20?name=arice' 404 Page Notfound.
High performance(benchmark: https://github.com/philopon/apiary/blob/v0.15.2/bench).
Nestable route handling(Apiary Monad; capture, method and more.).
Type safe route filter.
Auto generate API documentation(example: https://github.com/philopon/apiary/blob/v0.15.2/examples/api.hs, https://rawgit.com/philopon/apiary/v0.15.2/examples/api.html).
more examples: https://github.com/philopon/apiary/blob/v0.15.2/examples/
- Author
- HirotomoMoriwaki<philopon.dependence@gmail.com>
- Bug reports
- https://github.com/philopon/apiary/issues
- Category
- Web
- Copyright
- (c) 2014 Hirotomo Moriwaki
- Homepage
- https://github.com/philopon/apiary
- Maintainer
- HirotomoMoriwaki<philopon.dependence@gmail.com>
- Package URL
- n/a
- Stability
- experimental