We'll now explore the flow of a traditional HTTP request, analyzing each step of the process up to when a response is rendered. As we've seen in the last section, Plug provides an adapter for the Cowboy web server, which we've used to demonstrate the two plugs we've created. Phoenix also uses this adapter to interact with the Cowboy web server. When a requests hits the server, this adapter handles it, creates a new conn (a %Plug.Conn{} struct), and calls the endpoint configured in your application. By default, the endpoint is called <name_of_your_app>.Endpoint. The endpoint is the boundary between the web server and our application code, so essentially the endpoint is the beginning of a request. Let's see the configuration ...
Routing requests
Get Mastering Elixir now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.