-
Notifications
You must be signed in to change notification settings - Fork 11
/
MIDDLEWARE_LIST
50 lines (36 loc) · 2 KB
/
MIDDLEWARE_LIST
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
MIDDLEWARE RUN ENV LABEL
Pancake:
rack-bug - development - debugger
deflect - production - nil
etag - production - etag
deflator - production - deflator
rack-cache - production - cache
ShowExceptions - development - exceptions
content_length - all - nil
content_type - all - nil
mime-type - all - nil
session - all cookie (configurable) - session
methodoverride - all - nil
NestedParams - all - nil
rack-uploads - all - upload_parsing
warden - all - auth
Pancake Stacks:
[file - for each root] - development - static
middleware, opts, block : middleware
class MyApp
use Middleware, :middleware => :opts
mixture.add(:foo, :after => :session).use(MyFoo)
mixture.replace(:session).use( MyOtherSession )
mixture.configure(:session){|config| #stuff }
end
use Middleware, {:middleware => :opts}, {:name => :auth, :after => :session, :env => :all}
with_use :env => :all, :after => :session do
use Middlware, :middleware => :opts
end
mware(:auth, :after => :session, :env => :all).use Middlware, :middleware => :opts
mware_replace(:session).use MySessions, :session => :opts
use(Middleware, :middleware => :opts).after(:session).env(:all).register
use(Middleware, :middleware => :opts).register(::auth, after => :session, :env => :all)
configuration.mware(:authentication, :after => :session, :env => :all).use( MiddleWare, {:middleware => :opts}) do |mw|
# Stuff in there if there's a middlware block on initialization
end