From 46e32ec286e8d8d412327d2b5b3bbf446f80936f Mon Sep 17 00:00:00 2001 From: Karol Wojtaszek Date: Sun, 19 Mar 2017 19:47:34 +0100 Subject: [PATCH] Support for Phoenix 1.3 --- README.md | 4 +++- lib/phoenix_api_docs/generator.ex | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 98ddc3d..03dcb9b 100644 --- a/README.md +++ b/README.md @@ -138,12 +138,14 @@ The configuration options can be setup in `config.exs`: ```elixir config :phoenix_api_docs, docs_path: "priv/static/docs", - theme: "triple" + theme: "triple", + router: YourApp.Web.Router ``` Config options: * `docs_path`: Specify the path where the documentation will be generated. If you want to serve the documentation directly from the `phoenix` you can specify `priv/static/docs`. * `theme`: HTML theme is generated using the [Aglio renderer](https://github.com/danielgtaylor/aglio). +* `router`: Router of your application, in Phoenix 1.3 it will be YourAppName.Web.Router ## Common problems diff --git a/lib/phoenix_api_docs/generator.ex b/lib/phoenix_api_docs/generator.ex index c0224e9..f438561 100644 --- a/lib/phoenix_api_docs/generator.ex +++ b/lib/phoenix_api_docs/generator.ex @@ -3,7 +3,7 @@ defmodule PhoenixApiDocs.Generator do def run do test_conns = PhoenixApiDocs.ConnLogger.conns app_module = Mix.Project.get.application |> Keyword.get(:mod) |> elem(0) - router_module = Module.concat([app_module, :Router]) + router_module = Application.get_env(:phoenix_api_docs, :router, Module.concat([app_module, :Router])) %{ host: Keyword.get(api_docs_info, :host, "http://localhost"),