Packages

Arke project generator. Provides a `mix arke.new` task to bootstrap a new Elixir application with Arke dependencies.

Current section

Files

Jump to
arke_new templates starter router.ex
Raw

templates/starter/router.ex

defmodule <%= @arke_ns %>.Router do
@moduledoc """
Module where all the routes are defined. Too see the ones already available
run in the CLI: `mix phx.routes ArkeServer.Router`.
N.B. the /lib routes are relative to the arke_server package. To avoid future conflicts
please use another path like /app
"""&& false
use <%= @arke_ns %>, :router
pipeline :api do
plug :accepts, ["json"]
end
# Below define all the routes of your application
scope "/app", <%= @arke_ns %> do
pipe_through :api
get "/", PageController, :home
end
<%= if @dashboard do %>
if Application.compile_env(:<%= @arke_app_name %>, :dev_routes) do<%= if @dashboard do %>
# If you want to use the LiveDashboard in production, you should put
# it behind authentication and allow only admins to access it.
# If your application does not have an admins-only section yet,
# you can use Plug.BasicAuth to set up some basic authentication
# as long as you are also using SSL (which you should anyway).
import Phoenix.LiveDashboard.Router<% end %>
scope "/dev" do
pipe_through [:fetch_session, :protect_from_forgery]
<%= if @dashboard do %>
live_dashboard "/dashboard", metrics: <%= @arke_ns %>.Telemetry<% end %>
end
end<% end %>
end