forked from manveru/innate
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Easier way of defining custom middleware.
Instead of requiring developers to monkey-patch the Innate module in order to add their own middleware people can now use `Innate.middleware` similar to the traditional `Innate.middleware!` method. Example use: Innate.middleware(:dev) do use Rack::Head use Rack::Reloader, 2 run Innate.core end Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
- Loading branch information
Yorick Peterse
committed
Dec 5, 2012
1 parent
42e6a33
commit 1746fe4
Showing
4 changed files
with
115 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Innate.middleware(:dev) do | ||
use Rack::Lint | ||
use Rack::Head | ||
use Rack::ContentLength | ||
use Rack::CommonLogger | ||
use Rack::ShowExceptions | ||
use Rack::ShowStatus | ||
use Rack::ConditionalGet | ||
use Rack::Reloader, 2 | ||
|
||
run Innate.core | ||
end | ||
|
||
Innate.middleware(:live) do | ||
use Rack::Head | ||
use Rack::ContentLength | ||
use Rack::CommonLogger | ||
use Rack::ShowStatus | ||
use Rack::ConditionalGet | ||
|
||
run Innate.core | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters