View Source Fast.Plug.Ready (Fast v0.9.0)
A plug for responding to "ready" check requests.
This plug responds with "200 YES" when ready, "423 NO" otherwise.
It checks the :ready_for_traffic
env var to determine
if the application is ready for traffic.
options
Options
:otp_app
- app name that the config belongs to:path
- request path string to handle requests for:json
- a boolean to decide whether response should be json
examples
Examples
defmodule MyServer do
use Plug.Builder
plug Fast.Plug.Ready
# ... rest of the pipeline
end
Using a custom path:
defmodule MyServer do
use Plug.Builder
plug Fast.Plug.Ready, otp_app: :my_app, path: "/ready"
# ... rest of the pipeline
end
Link to this section Summary
Link to this section Functions
Callback implementation for Plug.call/2
.
Callback implementation for Plug.init/1
.