This commit is contained in:
zack 2024-10-22 16:51:56 -04:00
parent e2967f68b2
commit ef2a6c41b4
No known key found for this signature in database
GPG key ID: 5F873416BCF59F35
39 changed files with 2349 additions and 30 deletions

View file

@ -13,22 +13,22 @@ defmodule ZoeyscomputerWeb.Router do
plug :fetch_current_user
end
pipeline :api_authentication do
plug ZoeyscomputerWeb.Plugs.ApiAuthentication
end
pipeline :api do
plug :accepts, ["json"]
end
# scope "/", ZoeyscomputerWeb do
# pipe_through :browser
#
# live_session :current_user,
# on_mount: [{ZoeyscomputerWeb.UserAuth, :mount_current_user}] do
# live "/", HomeLive, :index
# end
# end
# Other scopes may use custom stacks.
scope "/api", ZoeyscomputerWeb do
pipe_through :api
resources "/images", ImageController, except: [:create, :edit]
pipe_through [:api_authentication]
post "/images/create", ImageController, :create
end
# Enable LiveDashboard and Swoosh mailbox preview in development
@ -76,6 +76,18 @@ defmodule ZoeyscomputerWeb.Router do
live "/users/settings/confirm_email/:token", UserSettingsLive, :confirm_email
live "/links", LinkLive.Index
live "/links/new", LinkLive.New
live "/images/new", ImageLive.Index, :new
live "/images/:id/edit", ImageLive.Index, :edit
live "/images/:id/show/edit", ImageLive.Show, :edit
live "/api-keys", ApiKeyLive.Index, :index
live "/api-keys/new", ApiKeyLive.Index, :new
live "/api-keys/:id/edit", ApiKeyLive.Index, :edit
live "/api-keys/:id", ApiKeyLive.Show, :show
live "/api-keys/:id/show/edit", ApiKeyLive.Show, :edit
end
end
@ -89,6 +101,9 @@ defmodule ZoeyscomputerWeb.Router do
live "/users/confirm/:token", UserConfirmationLive, :edit
live "/users/confirm", UserConfirmationInstructionsLive, :new
live "/", HomeLive, :index
live "/images", ImageLive.Index, :index
live "/images/:id", ImageLive.Show, :show
end
end
end