Quenya.Plug.SwaggerPlug (Quenya v0.3.2) View Source

Plug for swagger static UI. You must use Plug.Static to serve static files in priv/swagger

Example:

# in your router file
# before anything
plug Plug.static, at: "/swagger/main.yml", from: {:app, "priv/spec/main.yml"}
plug Plug.static, at: "/public", from: {:quenya, "priv/swagger"}

# after dispatch
get "/swagger", to: Quenya.Plug.SwaggerPlug, init_opts: [spec: "/swagger/main.json"]
get "/swagger/main.json", to: Quenya.Plug.SwaggerPlug, init_opts: [app: :todo]

Link to this section Summary

Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Link to this section Functions

Specs

call(Plug.Conn.t(), keyword()) :: Plug.Conn.t()

Callback implementation for Plug.call/2.

Specs

init(keyword()) :: keyword()

Callback implementation for Plug.init/1.