packages feed

apiary-0.7.0.0: apiary.cabal

name:                apiary
version:             0.7.0.0
synopsis:            Simple web framework inspired by scotty.
description:
  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|/:Int|] . ("name" =: pLazyByteString) . stdMethod GET . action $ \\age name -> do
        guard (age >= 18)
        contentType "text/html"
        lbs . L.concat $ ["<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.
  @
  .
    * Nestable route handling(Apiary Monad; capture, stdMethod and more.).
  .
    * type safe route filter.
  .
  more examples: <https://github.com/philopon/apiary/blob/master/examples/>

license:             MIT
license-file:        LICENSE
author:              HirotomoMoriwaki<philopon.dependence@gmail.com>
maintainer:          HirotomoMoriwaki<philopon.dependence@gmail.com>
Homepage:            https://github.com/philopon/apiary
Bug-reports:         https://github.com/philopon/apiary/issues
copyright:           (c) 2014 Hirotomo Moriwaki
category:            Web
build-type:          Simple
stability:           experimental
-- extra-source-files:  
cabal-version:       >=1.10

library
  exposed-modules:     Web.Apiary

                       Control.Monad.Apiary
                       Control.Monad.Apiary.Filter
                       Control.Monad.Apiary.Filter.Internal
                       Control.Monad.Apiary.Filter.Internal.Capture
                       Control.Monad.Apiary.Filter.Internal.Strategy
                       Control.Monad.Apiary.Action

                       Data.Apiary.SList
                       Data.Apiary.Param

  other-modules:       Control.Monad.Apiary.Internal
                       Control.Monad.Apiary.Action.Internal
                       Control.Monad.Apiary.Filter.Internal.Capture.TH
                       Web.Apiary.TH
  other-extensions:    KindSignatures
                     , DataKinds
                     , TypeOperators
                     , GADTs
                     , TypeFamilies

                     , Rank2Types
                       
  build-depends:       base              >=4.6 && <4.8
                     , template-haskell  >=2.8 && <2.10
                     , transformers      >=0.3 && <0.5
                     , mtl               >=2.1 && <2.3
                     , monad-control     >=0.3 && <0.4
                     , transformers-base >=0.4 && <0.5

                     , text               >=1.1 && <1.2
                     , bytestring         >=0.10 && <0.11
                     , blaze-builder      >=0.3 && <0.4
                     , conduit            >=1.1 && <1.2
                     , data-default-class >=0.0 && <0.1
                     , tagged             >=0.7 && <0.8
                     , reflection         >=1.4 && <1.5

                     , http-types        >=0.8 && <0.9
                     , mime-types        >=0.1 && <0.2
                     , wai               >=2.1 && <2.2
                     , warp              >=2.1 && <2.2

  hs-source-dirs:      src
  ghc-options:         -O2 -Wall
  default-language:    Haskell2010

test-suite test-framework
  main-is:             main.hs
  type:                exitcode-stdio-1.0
  build-depends:       base                 >=4.6 && <4.8
                     , test-framework       >=0.8 && <0.9
                     , test-framework-hunit >=0.3 && <0.4
                     , wai                  >=2.1 && <2.2
                     , wai-test             >=2.0 && <2.1
                     , apiary
                     , bytestring           >=0.10 && <0.11
                     , http-types        >=0.8 && <0.9
  hs-source-dirs:      test
  ghc-options:         -O2 -Wall -fno-warn-missing-signatures
  default-language:    Haskell2010

source-repository head
  type:     git
  location: git://github.com/philopon/apiary.git