0PricingLogin
Elixir & Phoenix: Scalable Backend Development · Lesson

Routing, Controllers, and Plugs

Define routes, implement controller actions, and use Plugs to build modular and reusable request pipelines.

Mapping Your Web Requests

Welcome to routing in Phoenix! Think of routing as your application's traffic controller. When a user visits a URL, the router determines which part of your code should handle that request.

It's how Phoenix connects an incoming web address (like /users) to a specific function in your application.

The `router.ex` File

In Phoenix, all your routes are defined in the lib/my_app_web/router.ex file. This file uses special macros to declare how different HTTP methods (GET, POST, PUT, DELETE) map to your application's logic.

You'll often see routes grouped into scopes and processed by pipelines, which apply common behaviors.

All lessons in this course

  1. Phoenix Project Setup and Structure
  2. Routing, Controllers, and Plugs
  3. Views, Templates, and LiveView Basics
  4. Real-Time Features with Phoenix Channels
← Back to Elixir & Phoenix: Scalable Backend Development