ApiManagementConsoleV2.Router (api_management_console v0.1.0)

Copy Markdown View Source

Provides the api_console/1 macro to mount console routes into a Phoenix router.

The macro is transparent — it defines login routes and protected dashboard routes under the given path with session-based authentication. The consumer controls the outer pipeline and scoping.

Using the macro

# In your router module — `use` defines the auth pipeline:
use ApiManagementConsoleV2.Router

scope "/" do
  pipe_through [:browser]
  api_console "/admin/apis"
end

Manual setup (no macro)

See the README for a manual route listing if you prefer full control.

Summary

Functions

Sets up the API console in the caller's router module.

Mounts the API console LiveView dashboard under the given path.

Functions

__using__(opts)

(macro)

Sets up the API console in the caller's router module.

Defines the :api_console_auth pipeline (Basic Auth via RequireAdmin) and imports the api_console/1 macro.

api_console(path)

(macro)

Mounts the API console LiveView dashboard under the given path.

Routes are wrapped with the :api_console_auth pipeline (session-based auth). Credentials are managed via the login page (default: admin / admin123).