defmodule Quenya.Plug.SwaggerPlug do @moduledoc """ 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] """ import Plug.Conn @behaviour Plug @template """