talira

Compose web applications with functions

open sourceApache-2.0free

Plug is an Elixir library that defines a specification for composing web applications from small functions (plugs) that each take and return a connection, together with connection adapters for web servers on the Erlang VM, so the same app runs on the Cowboy web server (through plug_cowboy) or Bandit. It includes a router, parsers, sessions, static file serving and testing helpers, and web frameworks such as Phoenix are built on it.

Problems it solves

  • write a small Elixir web service without a full framework
  • add middleware to an Elixir web app
  • compose HTTP request handling from functions in Elixir
  • run the same Elixir web app on Cowboy or Bandit

Features

  • composable plug specification
  • Cowboy and Bandit adapters
  • router
  • test helpers