Learn Phoenix routing fundamentals including resourceful routes, nested resources, scopes, and pipelines
Learn Phoenix routing fundamentals including resourceful routes, nested resources, scopes, and pipelines.
router.ex
or by running mix phx.routes
grep
) to filter routes by resource (e.g., products)resources "/products", ProductController
to auto-generate all CRUD endpoints (GET, POST, PUT/PATCH, DELETE)only: [:index, :show]
or exclude with except: [:delete]
resources "/users", UserController do
resources "/posts", PostController
end
/api
, /dashboard
) and run different pipelines/
/api
/dashboard
:browser
pipeline for standard web pages, or custom ones like :auth
for authenticationpipe_through [:browser, :auth]
)resources
if you need most CRUD routesThis lesson covers Phoenix router basics, resourceful/nested routes, scopes, and pipelines for organizing endpoint behavior and authentication.