Commit graph

136 commits

Author SHA1 Message Date
Jan van Brügge
dbbe9b7321 Allow to specify the status of streaming endpoints 2018-05-28 12:00:29 +02:00
Jan van Brügge
0ba09c999b Change definition of StreamGenerator 2018-05-24 05:08:48 +02:00
Alp Mestanogullari
fd21e92cf2 servant-server: make file-serving functions polymorphic in the monad 2018-04-25 15:12:32 +02:00
Oleg Grenrus
dd7ec1dfd7 Allow base-compat-0.10.0 2018-04-11 11:26:14 +03:00
Giovanni Cappellotto
92f8d2314e Update request content-type handling
In case that a sub-server doesn't support the content-type specified
in the request invoke `delayedFail` instead of `delayedFailFatal` in
order to give the chance to other sub-servers to handle the request.
2018-04-04 18:53:40 -04:00
Oleg Grenrus
3e1748c965 Add description modifier helpers and parametrise Capture 2018-02-15 12:28:42 +02:00
Oleg Grenrus
77600e661b Support resourcet-1.2 2018-02-08 11:27:38 +02:00
Oleg Grenrus
22ec980f6e Update hlint.yaml and fix some hints in servant and servant-server 2018-01-26 17:38:57 +02:00
Oleg Grenrus
bc3f61d615 Add Servant.API.Modifiers to servant
Changes Header, ReqBody and QueryParam to take a modifier list.

Resolves https://github.com/haskell-servant/servant/issues/856

ResponseHeader story turns to be somewhat ugly, but it can be made
elegant when https://github.com/haskell-servant/servant/issues/841 is
implemnted, then we can omit HList aka Header Heterogenous List
implementation.

- servant-server changes:

  Writing server side intepretations is quite simple using
  `unfoldRequestArgument`, which makes Header and QueryParam look quite
  the same.

  `ReqBody` cannot be easily made optional with current design (what that
  would mean: No Content-Type Header?), so that dimensions isn't used
  there.

- Add HasLink for all the rest ComprehensiveAPI combinators
- Add 'tricky' Header', QueryParam' endpoints to ComprehensiveAPI
- servant-docs: Quick'n'dirty implementation. Don't use modifiers information (yet).
2018-01-25 09:10:11 +02:00
Oleg Grenrus
6533d4bee5 Void -> TypeError
This doesn't work on GHC-8.0. I have trouble finding a ticket though.
See
https://ghc.haskell.org/trac/ghc/wiki/Proposal/CustomTypeErrors#DesignquestionsRAE
2018-01-22 18:40:23 +02:00
Oleg Grenrus
43895c83f9 Add two HasServer instances which won't ever exist
Resolves https://github.com/haskell-servant/servant/issues/887
2018-01-20 18:35:57 +02:00
Gershom
85cf8d1c60 Merge branch 'master' into gb-streaming 2017-11-04 00:15:35 -04:00
gbaz
da98c94e2f refactor servant.server.internal to consolidate functions (#837)
refactor servant.server.internal to consolidate functions
2017-10-28 20:17:24 +02:00
Gershom
9a2ac6f4dd HasClient instance for Stream 2017-10-20 15:09:11 -04:00
Gershom
d4168aa3ae first round of changes 2017-10-19 17:41:49 -04:00
Gershom
c5e04514f9 initial checkin 2017-10-18 18:43:43 -04:00
Oleg Grenrus
15cc4f55dd Update docs related to hoistServer 2017-10-01 20:24:22 +03:00
Vaibhav Sagar
1a10972904 Update servant-server/src/Servant/Server/Internal.hs
s/taylor/tailor
2017-09-17 11:40:12 +08:00
Oleg Grenrus
24af338dea Add hoistServer to HasServer 2017-09-14 12:04:34 +03:00
Catherine Galkina
ec0431d930 Add instances for new combinators 2017-06-08 18:27:36 +03:00
Oleg Grenrus
b6cfd64b5a GHC-8.2 readyness 2017-05-24 08:02:57 +03:00
David Turner
a3c5f17749 Generalise type of emptyServer so it can be Entered 2017-05-17 05:17:08 +00:00
David Turner
f3ac10a1c4 Add missing DeriveDataTypeable 2017-05-16 16:26:47 +00:00
David Turner
f5d9983381 Rename emptyAPIServer to emptyServer 2017-05-16 15:59:41 +00:00
David Turner
6feb27e7b2 Rename EmptyAPIServer to EmptyServer and add deriving clause 2017-05-16 15:53:19 +00:00
David Turner
62560079b1 Add docs for serving an EmptyAPI 2017-05-16 11:09:54 +00:00
David Turner
94483d586c Add instance HasServer EmptyAPI 2017-05-16 10:06:25 +00:00
Alexander Vieth
6389134423 Change to ServerT Raw m = Tagged m Application
For uniformity of Enter.

Previously, `ServerT Raw m ~ Application`. Seems reasonable, but has the
unfortunate consequence of making `Enter` useless for `Raw` routes.
With this change `Tagged m Application` is retagged by `Enter`.
2017-05-15 19:54:43 +03:00
Jack Kelly
f52bd11d6b Servant.Server: Re-export missing error codes 2017-05-05 18:39:01 +10:00
Oleg Grenrus
d0048057cd Merge pull request #736 from phadej/entered
Redo Enter
2017-05-05 10:17:34 +03:00
Oleg Grenrus
e2665391f9 Redo Enter 2017-04-28 14:31:57 +03:00
Philipp Balzarek
08786aadbe Check for parse errors in HasServer Header instance 2017-04-06 14:52:55 +02:00
Oleg Grenrus
58e931f48a Resolve todos 2017-01-19 11:26:50 +02:00
Philipp Balzarek
3a0cbdd0f6 throw 400 on query parameter parse failure 2017-01-19 11:09:30 +02:00
Oleg Grenrus
d4fe0e582a Fix stylistic issues 2017-01-19 00:57:31 +02:00
Oleg Grenrus
2caabad61a Expose ResourceT, fix the test 2017-01-19 00:57:31 +02:00
Oleg Grenrus
bc6ff20f4d Use resourcet for resource managment 2017-01-19 00:57:31 +02:00
Alp Mestanogullari
bc13d5cd3e warning free 2017-01-17 23:10:29 +02:00
Alp Mestanogullari
92786feead add some basic tests for the cleanup machinery in Delayed 2017-01-17 22:29:37 +02:00
Alp Mestanogullari
5d1f03ba1a use an ioref to store clean up actions instead of a field in Delayed, allowing early clean up registration 2017-01-17 22:29:37 +02:00
Alp Mestanogullari
7fb11dae3c make cleanup in Delayed more resistant to exceptions 2017-01-17 22:29:37 +02:00
Alp Mestanogullari
6ab0296d62 fix a warning 2017-01-17 22:29:37 +02:00
Alp Mestanogullari
124c6de1eb add a field in Delayed that lets us specify a clean up action that can use the result of bodyD to perform some IO clean up operation 2017-01-17 22:29:36 +02:00
Alp Mestanogullari
6d35f3d88f reintroduce serveDirectory (to give some time to users to change their code), but deprecate it 2017-01-17 14:14:46 +02:00
Alp Mestanogullari
0a3b2272de fix static file serving test 2017-01-17 14:14:46 +02:00
Alp Mestanogullari
8efabed5c6 Revamp static file serving module.
Instead of only exposing 'serveDirectory', which picks a specific static file
serving strategy (file server settings), we now expose 4 different variants each
corresponding to an variant of StaticSettings in wai-app-static.

In addition to these, we expose a more flexible 'serveDirectoryWith' function
which allows the user to specify some arbitrary StaticSettings, if the 4
existing variants do not cover a user's needs.
2017-01-17 14:14:46 +02:00
Oleg Grenrus
5168157757 Make Handler a newtype 2017-01-16 12:18:49 +02:00
Yusuke Sangenya
d2a51396cc add HTTP status code 422 2016-12-03 16:44:34 +09:00
Sönke Hahn
3f6ecbb77b add err418 2016-10-24 10:42:48 -04:00
Julian K. Arni
501212e6b9 Review fixes 2016-09-12 20:40:03 -03:00