| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
Date: Sat, 17 Jan 2026 22:20:03 GMT
X-Served-By: cache-dfw-kdal2120110-DFW, cache-bom-vanm7210025-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768688403.145997,VS0,VE313
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
apiary: Simple and type safe web framework that generate web API documentation.
apiary: Simple and type safe web framework that generate web API documentation.
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 = runApiary (run 3000) def $ do
[capture|/age::Int|] . ([key|name|] =: pLazyByteString) . method GET . action $ do
(age, name) <- [params|age,name|]
guard (age >= 18)
contentType "text/html"
mapM_ appendLazyBytes ["<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-benchmark).
Nestable route handling(Apiary Monad; capture, method and more.).
Type safe route filter.
Auto generate API documentation(example: https://find-hackage.herokuapp.com/api/documentation).
more examples: https://github.com/philopon/apiary/blob/v1.4.0/examples/
live demo: https://find-hackage.herokuapp.com/ (source code: https://github.com/philopon/find-hackage)
Downloads
- apiary-2.1.2.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.2.0.0, 0.3.0.0, 0.3.1.0, 0.3.2.0, 0.4.0.0, 0.4.0.1, 0.4.0.2, 0.4.2.0, 0.4.3.0, 0.4.3.1, 0.4.3.2, 0.5.0.0, 0.5.1.0, 0.6.0.0, 0.6.0.1, 0.6.1.0, 0.7.0.0, 0.8.0.0, 0.9.0.0, 0.10.0, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.12.0, 0.12.1, 0.12.2, 0.12.3, 0.12.4, 0.12.5, 0.12.6, 0.12.7, 0.12.8, 0.13.0, 0.14.0, 0.14.0.1, 0.15.0, 0.15.1, 0.15.2, 0.16.0, 0.17.0, 0.17.1, 0.17.2, 1.0.0, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.3.0, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 2.0.0, 2.0.1, 2.0.1.1, 2.0.2, 2.1.0, 2.1.1, 2.1.2 (info) |
|---|---|
| Change log | CHANGELOG.md |
| Dependencies | aeson (>=0.8 && <1.3), base (>=4.7 && <5.0), blaze-builder (>=0.3 && <0.5), blaze-html (>=0.7 && <0.9), blaze-markup (>=0.6 && <0.8), bytestring (>=0.10 && <0.11), bytestring-lexing (>=0.5 && <0.6), case-insensitive (>=1.1 && <1.3), data-default-class (>=0.0 && <0.1), exceptions (>=0.6 && <0.9), ghc-prim, hashable (>=1.1 && <1.3), hetero-dict (>=0.1.1 && <0.1.2), http-date (>=0.0 && <0.1), http-types (>=0.8 && <0.10), mime-types (>=0.1 && <0.2), monad-control (>=0.3 && <1.1), mtl (>=2.1 && <2.3), primitive, process (>=1.2 && <2.0), resourcet (>=0.4.6 && <1.2), stringsearch (>=0.3 && <0.4), template-haskell (>=2.8 && <2.13), text (>=1.1 && <1.3), time (>=1.4 && <1.9), transformers (>=0.2 && <0.6), transformers-base (>=0.4 && <0.6), unix-compat (>=0.4 && <0.5), unordered-containers (>=0.2 && <0.3), vault (>=0.3 && <0.4), wai (>=3.0 && <3.3), wai-extra (>=3.0.15 && <3.1) [details] |
| License | MIT |
| Copyright | (c) 2014-2015 Hirotomo Moriwaki |
| Author | HirotomoMoriwaki<philopon.dependence@gmail.com> |
| Maintainer | HirotomoMoriwaki<philopon.dependence@gmail.com>, 韩冬<drkoster@qq.com> |
| Uploaded | by winterland at 2017-10-27T10:14:50Z |
| Revised | Revision 1 made by winterland at 2018-03-15T09:05:51Z |
| Category | Web |
| Home page | https://github.com/winterland1989/apiary |
| Bug tracker | https://github.com/winterland1989/apiary/issues |
| Source repo | head: git clone git://github.com/philopon/apiary.git |
| Distributions | |
| Reverse Dependencies | 15 direct, 0 indirect [details] |
| Downloads | 59040 total (327 in the last 30 days) |
| Rating | 2.5 (votes: 3) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2017-10-27 [all 1 reports] |