Skip to content

Encoding primitives for Dream applications.

License

Notifications You must be signed in to change notification settings

andreypopp/dream-encoding

 
 

Repository files navigation

Dream Encoding

Actions Status

Encoding primitives for Dream.

Usage

The most common usage is to add the Dream_encoding.compress middleware to your Dream application:

let () =
  Dream.run ~debug:true
  @@ Dream.logger
  @@ Dream_encoding.compress
  @@ Dream.router [ Dream.get "/" (fun _ -> Dream.html "Hello World!") ]
  @@ Dream.not_found

The middleware will parse the Accept-Encoding header from the requests and compress the responses accordingly.

The library API also includes other lower-level functions for convenience, and are documented here.

Limitation

As of now, the only supported encoding directives are gzip and deflate.

Support for more compression methods will come when they are supported in decompress, the underlying compression library used in dream-encoding.

To Do

About

Encoding primitives for Dream applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • OCaml 91.8%
  • Makefile 8.2%