You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/adapters.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,16 @@ run on any webserver that provides a Rack interface. It also lets it run on
10
10
In order to be compatible with popular deployment stacks,
11
11
Webmachine has a [Rack](https://github.com/rack/rack) adapter (thanks to Jamis Buck).
12
12
13
-
Webmachine can be used with Rack middlware features such as Rack::Map and Rack::Cascade as long as:
14
-
15
-
1. The Webmachine app is mounted at the root directory.
16
-
2. Any requests/responses that are handled by the Webmachine app are not modified by the middleware. The behaviours that are encapsulated in Webmachine assume that no modifications
13
+
Webmachine can be used with Rack middlware features such as Rack::Map and Rack::Cascade as long as any requests/responses that are handled by the Webmachine app are **not** modified by the middleware. The behaviours that are encapsulated in Webmachine assume that no modifications
17
14
are done to requests or response outside of Webmachine.
18
15
19
16
Keep in mind that Webmachine already supports many things that Rack middleware is used for with other HTTP frameworks (eg. etags, specifying supported/preferred Accept and Content-Types).
20
17
18
+
The base `Webmachine::Adapters::Rack` class assumes the Webmachine application
19
+
is mounted at the route path `/` (i.e. not using `Rack::Builder#map` or Rails
20
+
`ActionDispatch::Routing::Mapper::Base#mount`). In order to
21
+
map to a subpath, use the `Webmachine::Adapters::RackMapped` adapter instead.
22
+
21
23
For an example of using Webmachine with Rack middleware, see the [Pact Broker][middleware-example].
22
24
23
25
See the [Rack Adapter API docs][rack-adapter-api-docs] for more information.
0 commit comments