Skip to content

Commit

Permalink
Add example for proc-based route to Routing guide
Browse files Browse the repository at this point in the history
  • Loading branch information
severin committed May 12, 2021
1 parent f55010a commit 71e10a0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions guides/source/routing.md
Expand Up @@ -920,6 +920,8 @@ As long as `MyRackApp` responds to `call` and returns a `[status, headers, body]

NOTE: For the curious, `'articles#index'` actually expands out to `ArticlesController.action(:index)`, which returns a valid Rack application.

NOTE: Since procs/lambdas are objects that happen to respond to `call` you can implement very simple routes (e.g. for health checks) inline:<br>`get '/health', to: ->(env) { [204, {}, ''] }`

If you specify a Rack application as the endpoint for a matcher, remember that
the route will be unchanged in the receiving application. With the following
route your Rack application should expect the route to be `/admin`:
Expand Down

0 comments on commit 71e10a0

Please sign in to comment.