Skip to content

Commit b929920

Browse files
committed
updated documentation about rack to mention RackMapped
1 parent d4c05b5 commit b929920

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

documentation/adapters.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ run on any webserver that provides a Rack interface. It also lets it run on
1010
In order to be compatible with popular deployment stacks,
1111
Webmachine has a [Rack](https://github.com/rack/rack) adapter (thanks to Jamis Buck).
1212

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
1714
are done to requests or response outside of Webmachine.
1815

1916
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).
2017

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+
2123
For an example of using Webmachine with Rack middleware, see the [Pact Broker][middleware-example].
2224

2325
See the [Rack Adapter API docs][rack-adapter-api-docs] for more information.

0 commit comments

Comments
 (0)