3
Defining Web Application Specifications Using Plug
In the previous chapters, we took a deep dive into Cowboy to learn about some of its fundamentals. Then, using that knowledge, we built a web server using :gen_tcp. However, in both those chapters, we didn’t deal with any sort of complex route matching or other request formats. We will now learn how to accomplish that using the Plug package. In this chapter, we will learn how Plug works, understand some of its main components, and how we can use them to make our web server more usable.
By the end of this chapter, you will know the ins and outs of the Plug package and how Plug enables us to use Cowboy efficiently. You will also learn how to make Plug work with the HTTP server we built in the ...
Get Build Your Own Web Framework in 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.