commit
de965b208e
9 changed files with 41 additions and 8 deletions
|
@ -8,6 +8,14 @@ author: Servant Contributors
|
|||
maintainer: haskell-servant-maintainers@googlegroups.com
|
||||
build-type: Simple
|
||||
cabal-version: >=1.10
|
||||
tested-with:
|
||||
GHC==7.8.4
|
||||
GHC==7.10.3
|
||||
GHC==8.0.2
|
||||
GHC==8.2.1
|
||||
extra-source-files:
|
||||
static/index.html
|
||||
static/ui.js
|
||||
|
||||
library
|
||||
exposed-modules: ApiType
|
||||
|
@ -38,7 +46,8 @@ library
|
|||
, string-conversions
|
||||
, bytestring
|
||||
, attoparsec
|
||||
, mtl
|
||||
, mtl >=2.1 && <2.3
|
||||
, mtl-compat
|
||||
, random
|
||||
, js-jquery
|
||||
, wai
|
||||
|
@ -57,6 +66,8 @@ test-suite spec
|
|||
hs-source-dirs: test
|
||||
main-is: Spec.hs
|
||||
other-modules: JavascriptSpec
|
||||
build-tool-depends:
|
||||
hspec-discover:hspec-discover
|
||||
build-depends: base == 4.*
|
||||
, tutorial
|
||||
, hspec
|
||||
|
|
|
@ -43,7 +43,7 @@ library
|
|||
, generics-sop >= 0.1.0.0 && < 0.4
|
||||
, http-api-data >= 0.3.6 && < 0.4
|
||||
, http-media >= 0.6.2 && < 0.8
|
||||
, http-types >= 0.8.6 && < 0.10
|
||||
, http-types >= 0.8.6 && < 0.11
|
||||
, mtl >= 2.1 && < 2.3
|
||||
, network-uri >= 2.6 && < 2.7
|
||||
, safe >= 0.3.9 && < 0.4
|
||||
|
@ -70,5 +70,7 @@ test-suite spec
|
|||
, servant-client-core
|
||||
, hspec == 2.*
|
||||
, QuickCheck >= 2.7 && < 2.11
|
||||
build-tool-depends:
|
||||
hspec-discover:hspec-discover
|
||||
other-modules:
|
||||
Servant.Client.Core.Internal.BaseUrlSpec
|
||||
|
|
|
@ -41,7 +41,7 @@ library
|
|||
, http-client >= 0.4.30 && < 0.6
|
||||
, http-client-tls >= 0.2.2 && < 0.4
|
||||
, http-media >= 0.6.2 && < 0.8
|
||||
, http-types >= 0.8.6 && < 0.10
|
||||
, http-types >= 0.8.6 && < 0.11
|
||||
, exceptions >= 0.8 && < 0.9
|
||||
, monad-control >= 1.0.0.4 && < 1.1
|
||||
, mtl >= 2.1 && < 2.3
|
||||
|
@ -64,6 +64,8 @@ test-suite spec
|
|||
default-language: Haskell2010
|
||||
hs-source-dirs: test
|
||||
main-is: Spec.hs
|
||||
build-tool-depends:
|
||||
hspec-discover:hspec-discover
|
||||
other-modules:
|
||||
Servant.ClientSpec
|
||||
build-depends:
|
||||
|
|
|
@ -75,6 +75,8 @@ test-suite spec
|
|||
type: exitcode-stdio-1.0
|
||||
main-is: Spec.hs
|
||||
other-modules: Servant.DocsSpec
|
||||
build-tool-depends:
|
||||
hspec-discover:hspec-discover
|
||||
hs-source-dirs: test
|
||||
ghc-options: -Wall
|
||||
build-depends:
|
||||
|
|
|
@ -65,6 +65,8 @@ test-suite spec
|
|||
include-dirs: include
|
||||
main-is: Spec.hs
|
||||
other-modules: Servant.ForeignSpec
|
||||
build-tool-depends:
|
||||
hspec-discover:hspec-discover
|
||||
build-depends: base
|
||||
, hspec >= 2.1.8
|
||||
, servant
|
||||
|
|
|
@ -60,7 +60,7 @@ library
|
|||
, containers >= 0.5 && < 0.6
|
||||
, exceptions >= 0.8 && < 0.9
|
||||
, http-api-data >= 0.3 && < 0.4
|
||||
, http-types >= 0.8 && < 0.10
|
||||
, http-types >= 0.8 && < 0.11
|
||||
, network-uri >= 2.6 && < 2.7
|
||||
, monad-control >= 1.0.0.4 && < 1.1
|
||||
, mtl >= 2 && < 2.3
|
||||
|
@ -120,6 +120,8 @@ test-suite spec
|
|||
Servant.Server.UsingContextSpec.TestCombinators
|
||||
Servant.ServerSpec
|
||||
Servant.Utils.StaticFilesSpec
|
||||
build-tool-depends:
|
||||
hspec-discover:hspec-discover
|
||||
build-depends:
|
||||
base == 4.*
|
||||
, base-compat
|
||||
|
|
|
@ -33,7 +33,11 @@ import Network.HTTP.Types (Status (..), hAccept, hContentType,
|
|||
methodDelete, methodGet,
|
||||
methodHead, methodPatch,
|
||||
methodPost, methodPut, ok200,
|
||||
#if MIN_VERSION_http_types(0,10,0)
|
||||
imATeapot418,
|
||||
#else
|
||||
imATeaPot418,
|
||||
#endif
|
||||
parseQuery)
|
||||
import Network.Wai (Application, Request, requestHeaders, pathInfo,
|
||||
queryString, rawQueryString,
|
||||
|
@ -70,6 +74,11 @@ import Servant.Server.Experimental.Auth
|
|||
import Servant.Server.Internal.Context
|
||||
(NamedContext(..))
|
||||
|
||||
#if !MIN_VERSION_http_types(0,10,0)
|
||||
imATeapot418 :: Status
|
||||
imATeapot418 = imATeaPot418
|
||||
#endif
|
||||
|
||||
-- * comprehensive api test
|
||||
|
||||
-- This declaration simply checks that all instances are in place.
|
||||
|
@ -662,7 +671,7 @@ basicAuthApi = Proxy
|
|||
basicAuthServer :: Server BasicAuthAPI
|
||||
basicAuthServer =
|
||||
const (return jerry) :<|>
|
||||
(Tagged $ \ _ respond -> respond $ responseLBS imATeaPot418 [] "")
|
||||
(Tagged $ \ _ respond -> respond $ responseLBS imATeapot418 [] "")
|
||||
|
||||
basicAuthContext :: Context '[ BasicAuthCheck () ]
|
||||
basicAuthContext =
|
||||
|
@ -707,7 +716,7 @@ genAuthApi = Proxy
|
|||
|
||||
genAuthServer :: Server GenAuthAPI
|
||||
genAuthServer = const (return tweety)
|
||||
:<|> (Tagged $ \ _ respond -> respond $ responseLBS imATeaPot418 [] "")
|
||||
:<|> (Tagged $ \ _ respond -> respond $ responseLBS imATeapot418 [] "")
|
||||
|
||||
type instance AuthServerData (AuthProtect "auth") = ()
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ library
|
|||
, case-insensitive >= 1.2 && < 1.3
|
||||
, http-api-data >= 0.3 && < 0.4
|
||||
, http-media >= 0.4 && < 0.8
|
||||
, http-types >= 0.8 && < 0.10
|
||||
, http-types >= 0.8 && < 0.11
|
||||
, natural-transformation >= 0.4 && < 0.5
|
||||
, mtl >= 2.0 && < 2.3
|
||||
, mmorph >= 1 && < 1.2
|
||||
|
@ -118,6 +118,8 @@ test-suite spec
|
|||
Servant.API.ResponseHeadersSpec
|
||||
Servant.Utils.LinksSpec
|
||||
Servant.Utils.EnterSpec
|
||||
build-tool-depends:
|
||||
hspec-discover:hspec-discover
|
||||
build-depends:
|
||||
base == 4.*
|
||||
, base-compat
|
||||
|
|
|
@ -10,7 +10,8 @@ packages:
|
|||
extra-deps:
|
||||
- aeson-1.2.0.0
|
||||
- attoparsec-iso8601-1.0.0.0
|
||||
- http-media-0.7.0
|
||||
- cabal-doctest-1.0.2
|
||||
- http-api-data-0.3.7
|
||||
- http-media-0.7.0
|
||||
- http-types-0.10
|
||||
- servant-js-0.9.3
|
||||
|
|
Loading…
Reference in a new issue