O'Reilly logo

Elixir Cookbook by Paulo A Pereira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Cowboy and Phoenix

This chapter will cover the following recipes:

  • Cowboy
    • Setting up Cowboy
    • Serving static files
    • Implementing a websocket handler
  • Phoenix
    • Creating a Phoenix application
    • Defining routes
    • Creating a controller
    • Creating views and templates
    • Implementing topics
    • Protecting the Phoenix app with SSL

Introduction

In this chapter, we will look at Cowboy and Phoenix.

Cowboy is written in Erlang and its author, Loïc Hoguin, defines it as "a small, fast, and modular HTTP server."

Cowboy provides an HTTP 1.0/1.1 stack and supports websockets, SPDY, and REST. It is currently used in Phoenix, which is an Elixir web framework.

Phoenix was a project started by Chris McCord but currently has several contributors and is an excellent option to implement web ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required