package opium-graphql
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=326b91866de90baf535f8b7d4b2ff23e39d952e573c04b3c13f1054b59ff2fb6
sha512=59b83e7c8fe5f7ae328fb7f2343fe5b8fb735e8f6ee263cfd6c75bb179688ef7cf2b4586b35a2231ed3f3c1ada543021b7a4759326ae095eb77a5f38b9fa3a8a
doc/CHANGES.html
0.20.0
Added
- New
Authmodule to work withAuthorizationheader (#238) - New
basic_authmiddleware to protect handlers with aBasicauthentication method (#238) - New
Response.of_fileAPI for conveniently creating a response of a file (#244) - Add a package
opium-graphqlto easily create GraphQL server with Opium (#235) - Add a function
App.run_multicorethat uses pre-forking and spawns multiple processes that will handle incoming requests (#239)
Fixed
- Fix reading cookie values when multiple cookies are present in
Cookieheader (#246)
0.19.0
This release is a complete rewrite of the Opium's internal that switches from Cohttp to Httpaf. As demonstrated in several benchmarks, Httpaf's latency is much lower than Cohttp's in stress tests, so it is expected that Opium will perform better in these high pressure situations with this change.
The underlying HTTP server implementation is now contained in the rock package, that provides a Service and Filter implementation, inspired by Finagle's. The architecture is similar to Ruby's Rack library (hence the name), so one can compose complex web applications by combining Rock applications.
The rock package offers a very slim API, with very few dependencies, so it should be an attractive option for other Web framework to build on, which would allow the re-usability of middlewares and handlers, independently of the framework used (e.g. one could use Sihl middlewares with Opium, and vice versa).
Apart from the architectural changes, this release comes with a lot of additionnal utilities and middlewares which should make Opium a better candidate for complex web applications, without having to re-write a lot of common Web server functionnalities.
The Request and Response modules now provide:
- JSON encoders/decoders with
Yojson - HTML encoders/decoders with
Tyxml - XML encoders/decoders with
Tyxml - SVG encoders/decoders with
Tyxml - multipart/form encoders/decoders with
multipart_form_data - urlencoded encoders/decoders with
Uri
And the following middlewares are now built-in:
debuggerto display an HTML page with the errors in case of failuresloggerto log requests and responses, with a timerallow_corsto add CORS headersstaticto serve static content given a custom read function (e.g. read from S3)static_unixto to serve static content from the local filesystemcontent_lengthto add theContent-Lengthheader to responsesmethod_overrideto replace the HTTP method with the one found in the_methodfield ofapplication/x-www-form-urlencodedencodedPOSTrequests.etagto addETagheader to the responses and send an HTTP code304when the computed ETag matches the one specified in the request.method_requiredto filter the requests by method and respond with an HTTP code405if the method is not allowed.headto add supports forHEADrequest for handlers that receiveGETrequests.
Lastly, this release also adds a package opium-testing that can be used to test Opium applications with Alcotest. It provides Testable modules for every Opium types, and implements helper functions to easily get an Opium.Response from an Opium.Request.
0.18.0
- Make examples easier to find and add documentation related to features used in them. (#125, @shonfeder)
- Allow overriding 404 handlers (#127, @anuragsoni)
- Support cohttp streaming response (#135, #137, #139, @anuragsoni)
v0.17.1
- Change Deferred.t to Lwt.t in readme (#91, @rymdhund)
- Remove
cowfrom deps (#92, @anuragsoni)
v0.17.0
- Switch to dune (#88, @anuragsoni)
- Keep the "/" cookie default and expose all cookie directives (#82, @actionshrimp)
- Do not assume base 64 encoding of cookies (#74, @malthe)
- Add caching capabilities to middleware (#76, @mattjbray)