Skip to content

muhuk/aleph-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aleph-middleware

Aleph allows returning a deferred (of a response) from handlers. Middleware shipped with ring-core that modify responses choke on deferreds. This library provides Aleph compatible versions of these middleware.

Usage

Add the following to your :dependencies:

[aleph-middleware "0.2.0"]

Replace ring.middleware.* with aleph.middleware.*. Available middleware are:

  • aleph.middleware.content-type/wrap-content-type
  • aleph.middleware.cookies/wrap-cookies
  • aleph.middleware.file-info/wrap-file-info
  • aleph.middleware.not-modified/wrap-not-modified
  • aleph.middleware.session/wrap-session

Middleware that doesn't wrap responses can be used with Aleph without modification. If there are any other response wrapping middleware shipped with Ring, please create an issue.

Current version of aleph-middleware depends on [aleph "0.4.1"] & [ring/ring-core "1.5.0"].

Note that you don't have convert your normal responses to deferreds.

Non-core Middleware

Additionally following Aleph compatible middleware are provided. Note that dependencies in the following table are not dependencies of aleph-middleware and must be added to your project if you want to use them.

Project Dependencies Middleware
ring-cors [ring-cors "0.1.10"] aleph.middleware.cors

License

Copyright © 2015-2017 Atamert Ölçgen

Distributed under the MIT License

About

Ring middleware that support deferred responses.

Resources

Stars

Watchers

Forks

Packages

No packages published