OgEx.Router (og_ex v0.3.0)

Copy Markdown View Source

Installs the final path-image handler in a Phoenix router.

Import this module and call og_ex_routes/1 after all application routes:

defmodule MyAppWeb.Router do
  use MyAppWeb, :router
  import OgEx.Router

  scope "/", MyAppWeb do
    pipe_through :browser
    get "/posts/:id", PostController, :show
  end

  og_ex_routes()
end

Use either this router integration or plug OgEx, router: MyAppWeb.Router in the endpoint. Do not install both.

Summary

Functions

Adds the final catch-all route used by path-mode card declarations.

Functions

og_ex_routes(options \\ [])

(macro)

Adds the final catch-all route used by path-mode card declarations.

The macro must be called after application routes so explicitly owned routes take priority over OgEx image suffixes.