2022-01-04 22:06:23 +01:00
|
|
|
cabal-version: 2.2
|
2014-12-10 16:10:57 +01:00
|
|
|
name: servant-server
|
2022-03-21 14:13:52 +01:00
|
|
|
version: 0.19.1
|
2018-11-12 21:04:29 +01:00
|
|
|
|
2014-12-10 16:10:57 +01:00
|
|
|
synopsis: A family of combinators for defining webservices APIs and serving them
|
2018-11-12 21:04:29 +01:00
|
|
|
category: Servant, Web
|
2014-12-10 16:10:57 +01:00
|
|
|
description:
|
|
|
|
A family of combinators for defining webservices APIs and serving them
|
|
|
|
.
|
2019-03-02 10:08:03 +01:00
|
|
|
You can learn about the basics in the <http://docs.servant.dev/en/stable/tutorial/index.html tutorial>.
|
2014-12-10 16:10:57 +01:00
|
|
|
.
|
2015-04-20 15:55:41 +02:00
|
|
|
<https://github.com/haskell-servant/servant/blob/master/servant-server/example/greet.hs Here>
|
|
|
|
is a runnable example, with comments, that defines a dummy API and implements
|
|
|
|
a webserver that serves this API, using this package.
|
2015-04-20 16:00:51 +02:00
|
|
|
.
|
|
|
|
<https://github.com/haskell-servant/servant/blob/master/servant-server/CHANGELOG.md CHANGELOG>
|
2018-11-12 21:04:29 +01:00
|
|
|
|
2019-03-02 10:08:03 +01:00
|
|
|
homepage: http://docs.servant.dev/
|
2018-11-12 21:04:29 +01:00
|
|
|
bug-reports: http://github.com/haskell-servant/servant/issues
|
2021-10-31 22:37:56 +01:00
|
|
|
license: BSD-3-Clause
|
2014-12-10 16:10:57 +01:00
|
|
|
license-file: LICENSE
|
2016-01-20 16:58:29 +01:00
|
|
|
author: Servant Contributors
|
|
|
|
maintainer: haskell-servant-maintainers@googlegroups.com
|
2019-02-27 17:13:35 +01:00
|
|
|
copyright: 2014-2016 Zalora South East Asia Pte Ltd, 2016-2019 Servant Contributors
|
2020-01-09 21:19:24 +01:00
|
|
|
build-type: Simple
|
2021-10-02 12:56:23 +02:00
|
|
|
tested-with: GHC ==8.6.5 || ==8.8.4 || ==8.10.2 || ==9.0.1
|
2018-11-12 21:04:29 +01:00
|
|
|
|
2015-01-04 16:22:28 +01:00
|
|
|
extra-source-files:
|
|
|
|
CHANGELOG.md
|
|
|
|
README.md
|
2018-01-17 17:53:02 +01:00
|
|
|
|
2014-12-10 16:10:57 +01:00
|
|
|
source-repository head
|
|
|
|
type: git
|
2015-07-09 23:34:21 +02:00
|
|
|
location: http://github.com/haskell-servant/servant.git
|
2014-12-10 16:10:57 +01:00
|
|
|
|
|
|
|
library
|
|
|
|
exposed-modules:
|
|
|
|
Servant
|
|
|
|
Servant.Server
|
2016-03-06 22:23:55 +01:00
|
|
|
Servant.Server.Experimental.Auth
|
2018-07-04 21:59:43 +02:00
|
|
|
Servant.Server.Generic
|
2014-12-19 18:15:21 +01:00
|
|
|
Servant.Server.Internal
|
2016-02-17 19:56:15 +01:00
|
|
|
Servant.Server.Internal.BasicAuth
|
2016-03-06 22:23:55 +01:00
|
|
|
Servant.Server.Internal.Context
|
2019-02-27 12:04:33 +01:00
|
|
|
Servant.Server.Internal.Delayed
|
|
|
|
Servant.Server.Internal.DelayedIO
|
2020-06-14 11:15:30 +02:00
|
|
|
Servant.Server.Internal.ErrorFormatter
|
2017-01-16 10:44:25 +01:00
|
|
|
Servant.Server.Internal.Handler
|
New combinator to return routed path in response headers
This commit introduces a new type-level combinator, `WithRoutingHeader`.
It modifies the behaviour of the following sub-API, such that all endpoint
of said API return an additional routing header in their response.
A routing header is a header that specifies which endpoint the
incoming request was routed to.
Endpoint are designated by their path, in which `Capture'` and
`CaptureAll` combinators are replaced by a capture hint.
This header can be used by downstream middlewares to gather
information about individual endpoints, since in most cases
a routing header uniquely identifies a single endpoint.
Example:
```haskell
type MyApi =
WithRoutingHeader :> "by-id" :> Capture "id" Int :> Get '[JSON] Foo
-- GET /by-id/1234 will return a response with the following header:
-- ("Servant-Routed-Path", "/by-id/<id::Int>")
```
To achieve this, two refactorings were necessary:
* Introduce a type `RouterEnv env` to encapsulate the `env` type
(as in `Router env a`), which contains a tuple-encoded list of url
pieces parsed from the incoming request.
This type makes it possible to pass more information throughout the
routing process, and the computation of the `Delayed env c` associated
with each request.
* Introduce a new kind of router, which only modifies the RouterEnv, and
doesn't affect the routing process otherwise.
`EnvRouter (RouterEnv env -> RouterEnv env) (Router' env a)`
This new router is used when encountering the `WithRoutingHeader`
combinator in an API, to notify the endpoints of the sub-API that they
must produce a routing header (this behaviour is disabled by default).
2022-03-14 14:16:54 +01:00
|
|
|
Servant.Server.Internal.RouterEnv
|
2019-02-27 12:04:33 +01:00
|
|
|
Servant.Server.Internal.RouteResult
|
2020-06-14 11:15:30 +02:00
|
|
|
Servant.Server.Internal.Router
|
2015-06-01 19:38:51 +02:00
|
|
|
Servant.Server.Internal.RoutingApplication
|
2019-02-18 19:17:46 +01:00
|
|
|
Servant.Server.Internal.ServerError
|
2018-07-05 12:15:30 +02:00
|
|
|
Servant.Server.StaticFiles
|
2020-10-31 20:45:46 +01:00
|
|
|
Servant.Server.UVerb
|
2018-07-05 12:15:30 +02:00
|
|
|
|
|
|
|
-- deprecated
|
|
|
|
exposed-modules:
|
2014-12-10 16:10:57 +01:00
|
|
|
Servant.Utils.StaticFiles
|
2018-01-25 12:49:39 +01:00
|
|
|
|
|
|
|
-- Bundled with GHC: Lower bound to not force re-installs
|
|
|
|
-- text and mtl are bundled starting with GHC-8.4
|
|
|
|
build-depends:
|
2022-02-25 04:24:59 +01:00
|
|
|
base >= 4.9 && < 4.17
|
2020-12-16 11:04:49 +01:00
|
|
|
, bytestring >= 0.10.8.1 && < 0.12
|
2021-10-04 23:21:12 +02:00
|
|
|
, constraints >= 0.2 && < 0.14
|
2018-11-13 15:51:18 +01:00
|
|
|
, containers >= 0.5.7.1 && < 0.7
|
|
|
|
, mtl >= 2.2.2 && < 2.3
|
2022-02-06 23:12:25 +01:00
|
|
|
, text >= 1.2.3.0 && < 2.1
|
2018-11-13 15:51:18 +01:00
|
|
|
, transformers >= 0.5.2.0 && < 0.6
|
|
|
|
, filepath >= 1.4.1.1 && < 1.5
|
2018-04-09 11:26:35 +02:00
|
|
|
|
2018-01-25 12:49:39 +01:00
|
|
|
-- Servant dependencies
|
2018-11-12 21:04:29 +01:00
|
|
|
-- strict dependency as we re-export 'servant' things.
|
2018-01-25 12:49:39 +01:00
|
|
|
build-depends:
|
2022-03-30 02:10:54 +02:00
|
|
|
servant >= 0.19 && < 0.20
|
2021-04-05 16:35:39 +02:00
|
|
|
, http-api-data >= 0.4.1 && < 0.4.4
|
2018-01-25 12:49:39 +01:00
|
|
|
|
|
|
|
-- Other dependencies: Lower bound around what is in the latest Stackage LTS.
|
|
|
|
-- Here can be exceptions if we really need features from the newer versions.
|
2014-12-10 16:10:57 +01:00
|
|
|
build-depends:
|
2022-02-25 04:24:59 +01:00
|
|
|
base-compat >= 0.10.5 && < 0.13
|
2020-12-11 00:32:16 +01:00
|
|
|
, base64-bytestring >= 1.0.0.1 && < 1.3
|
2018-06-18 15:28:51 +02:00
|
|
|
, exceptions >= 0.10.0 && < 0.11
|
2019-04-16 11:45:13 +02:00
|
|
|
, http-media >= 0.7.1.3 && < 0.9
|
2018-11-09 18:04:47 +01:00
|
|
|
, http-types >= 0.12.2 && < 0.13
|
2019-01-22 14:24:16 +01:00
|
|
|
, network-uri >= 2.6.1.0 && < 2.8
|
2018-06-18 15:28:51 +02:00
|
|
|
, monad-control >= 1.0.2.3 && < 1.1
|
2019-05-28 14:27:52 +02:00
|
|
|
, network >= 2.8 && < 3.2
|
2020-10-31 20:45:46 +01:00
|
|
|
, sop-core >= 0.4.0.0 && < 0.6
|
2018-01-25 12:49:39 +01:00
|
|
|
, string-conversions >= 0.4.0.1 && < 0.5
|
2018-11-09 18:04:47 +01:00
|
|
|
, resourcet >= 1.2.2 && < 1.3
|
|
|
|
, tagged >= 0.8.6 && < 0.9
|
|
|
|
, transformers-base >= 0.4.5.2 && < 0.5
|
|
|
|
, wai >= 3.2.1.2 && < 3.3
|
|
|
|
, wai-app-static >= 3.1.6.2 && < 3.2
|
2018-01-25 12:49:39 +01:00
|
|
|
, word8 >= 0.1.3 && < 0.2
|
2015-06-23 10:34:20 +02:00
|
|
|
|
2014-12-10 16:10:57 +01:00
|
|
|
hs-source-dirs: src
|
|
|
|
default-language: Haskell2010
|
2020-10-31 20:45:46 +01:00
|
|
|
|
2018-07-11 00:39:38 +02:00
|
|
|
ghc-options: -Wall -Wno-redundant-constraints
|
2014-12-10 16:10:57 +01:00
|
|
|
|
|
|
|
executable greet
|
|
|
|
main-is: greet.hs
|
|
|
|
hs-source-dirs: example
|
|
|
|
ghc-options: -Wall
|
|
|
|
default-language: Haskell2010
|
|
|
|
build-depends:
|
|
|
|
base
|
2018-11-09 18:04:47 +01:00
|
|
|
, base-compat
|
2014-12-10 16:10:57 +01:00
|
|
|
, servant
|
|
|
|
, servant-server
|
|
|
|
, wai
|
|
|
|
, text
|
|
|
|
|
2018-06-18 15:28:51 +02:00
|
|
|
build-depends:
|
2021-11-18 14:10:45 +01:00
|
|
|
aeson >= 1.4.1.0 && < 3
|
2019-12-15 00:12:05 +01:00
|
|
|
, warp >= 3.2.25 && < 3.4
|
2018-06-18 15:28:51 +02:00
|
|
|
|
2014-12-10 16:10:57 +01:00
|
|
|
test-suite spec
|
|
|
|
type: exitcode-stdio-1.0
|
2016-04-18 12:07:23 +02:00
|
|
|
ghc-options: -Wall
|
2014-12-10 16:10:57 +01:00
|
|
|
default-language: Haskell2010
|
|
|
|
hs-source-dirs: test
|
|
|
|
main-is: Spec.hs
|
2015-09-23 18:26:05 +02:00
|
|
|
other-modules:
|
2016-08-14 19:58:05 +02:00
|
|
|
Servant.ArbitraryMonadServerSpec
|
2016-01-14 23:43:48 +01:00
|
|
|
Servant.Server.ErrorSpec
|
2016-02-28 23:23:32 +01:00
|
|
|
Servant.Server.Internal.ContextSpec
|
2017-01-12 02:58:29 +01:00
|
|
|
Servant.Server.Internal.RoutingApplicationSpec
|
2016-05-10 18:03:01 +02:00
|
|
|
Servant.Server.RouterSpec
|
2018-07-05 12:15:30 +02:00
|
|
|
Servant.Server.StaticFilesSpec
|
2016-05-10 18:03:01 +02:00
|
|
|
Servant.Server.StreamingSpec
|
2016-02-28 23:23:32 +01:00
|
|
|
Servant.Server.UsingContextSpec
|
|
|
|
Servant.Server.UsingContextSpec.TestCombinators
|
2017-11-07 13:12:19 +01:00
|
|
|
Servant.HoistSpec
|
2016-05-10 18:03:01 +02:00
|
|
|
Servant.ServerSpec
|
2018-01-25 12:49:39 +01:00
|
|
|
|
|
|
|
-- Dependencies inherited from the library. No need to specify bounds.
|
2014-12-10 16:10:57 +01:00
|
|
|
build-depends:
|
2018-01-25 12:49:39 +01:00
|
|
|
base
|
2016-03-01 09:19:13 +01:00
|
|
|
, base-compat
|
2016-04-06 09:24:30 +02:00
|
|
|
, base64-bytestring
|
2014-12-10 16:10:57 +01:00
|
|
|
, bytestring
|
2022-03-10 15:57:24 +01:00
|
|
|
, containers
|
2014-12-10 16:10:57 +01:00
|
|
|
, http-types
|
2017-01-18 10:37:18 +01:00
|
|
|
, mtl
|
|
|
|
, resourcet
|
2015-09-16 22:07:55 +02:00
|
|
|
, safe
|
2014-12-10 16:10:57 +01:00
|
|
|
, servant
|
2014-12-10 16:39:40 +01:00
|
|
|
, servant-server
|
2021-06-10 17:10:50 +02:00
|
|
|
, sop-core
|
2017-01-18 10:37:18 +01:00
|
|
|
, string-conversions
|
2014-12-10 16:10:57 +01:00
|
|
|
, text
|
|
|
|
, transformers
|
2015-09-12 15:28:20 +02:00
|
|
|
, transformers-compat
|
2014-12-10 16:10:57 +01:00
|
|
|
, wai
|
2015-05-03 01:27:48 +02:00
|
|
|
|
2020-06-06 06:43:51 +02:00
|
|
|
-- Additional dependencies
|
2018-01-25 12:49:39 +01:00
|
|
|
build-depends:
|
2021-11-18 14:10:45 +01:00
|
|
|
aeson >= 1.4.1.0 && < 3
|
2018-11-09 18:04:47 +01:00
|
|
|
, directory >= 1.3.0.0 && < 1.4
|
2022-03-21 15:37:40 +01:00
|
|
|
, hspec >= 2.6.0 && < 2.10
|
2020-10-01 10:16:27 +02:00
|
|
|
, hspec-wai >= 0.10.1 && < 0.12
|
2020-11-22 11:07:54 +01:00
|
|
|
, QuickCheck >= 2.12.6.1 && < 2.15
|
2018-01-25 12:49:39 +01:00
|
|
|
, should-not-typecheck >= 2.1.0 && < 2.2
|
2018-06-18 15:28:51 +02:00
|
|
|
, temporary >= 1.3 && < 1.4
|
2020-11-04 13:11:15 +01:00
|
|
|
, wai-extra >= 3.0.24.3 && < 3.2
|
2018-01-25 12:49:39 +01:00
|
|
|
|
|
|
|
build-tool-depends:
|
2022-03-21 15:37:40 +01:00
|
|
|
hspec-discover:hspec-discover >= 2.6.0 && <2.10
|