mesosteros
mesosteros

Reputation: 1519

How to route to generated Ex_Docs in Phoenix Framework

I used the ex_docs package to automatically generate documentation regarding my project modules in a Phoenix Framework project. Then with mix docs I successfully created the doc folder at the root of the project. However the contained files are full-fledged html files instead of templates. How can I route to these files with the Router?

Upvotes: 2

Views: 564

Answers (1)

The documentation is generated as static HTML files. You can serve static files with phoenix from the priv/static directory, copy your files from doc/ to the static directory.

You can find the configuration for the static file in your endpoint.ex file, see plug for documentation: http://hexdocs.pm/plug/Plug.Static.html.

Upvotes: 1

Related Questions