Skip to content

Commit

Permalink
refactor: make component showcase available in all config environments
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanemachine committed Jan 31, 2024
1 parent 782de0e commit 269fcb4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/quiz_game_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ defmodule QuizGameWeb.Router do
get "/terms-of-use", Controller, :terms_of_use
end

# DEV - allow any user
scope "/dev", QuizGameWeb.Dev do
pipe_through :browser

live "/component-showcase", Live.ComponentShowcase
end

# QUIZZES
scope "/quizzes", QuizGameWeb.Quizzes do
pipe_through [:browser]
Expand Down Expand Up @@ -161,17 +168,13 @@ defmodule QuizGameWeb.Router do
# SUPPORT - dev
if Application.compile_env(:quiz_game, :dev_routes) do
import Phoenix.LiveDashboard.Router
alias QuizGameWeb.Dev

scope "/dev" do
pipe_through :browser

# built-in routes
live_dashboard("/dashboard", metrics: QuizGameWeb.Telemetry)
forward "/mailbox", Plug.Swoosh.MailboxPreview

# custom project routes
live("/component-showcase", Dev.Live.ComponentShowcase)
end
end
end

0 comments on commit 269fcb4

Please # to comment.