Plug
Compose web applications with functions
Plug is a specification and toolkit for composing web applications with functions in Elixir. It provides a unified interface for handling HTTP connections and is the foundational layer used by Phoenix and other Elixir frameworks for request handling, routing, and WebSocket support.
3K
GitHub Stars
medium
Learning Curve
4.0
DX Score
Preços
Model
free
Plano Gratuito
Free and open-source under Apache License 2.0.
Recursos
- ✓ Module and function plug patterns
- ✓ Built-in Plug.Router for request dispatch
- ✓ WebSocket support via connection upgrade API
- ✓ Composable middleware pipeline
- ✓ Extremely fast route lookups
- ✓ Pre-built plugs for common tasks
- ✓ CSRF protection and session management
- ✓ SSL enforcement
- ✓ Static file serving
- ✓ Plug.Test for testing
Prós
- + Framework-agnostic and lightweight
- + Supports multiple web servers (Cowboy, Bandit)
- + Immutable connection model for safe concurrency
- + Direct access to streaming capabilities
- + Foundation for Phoenix framework
Contras
- - Requires external webserver dependency
- - Steeper learning curve for non-Elixir developers
- - Smaller ecosystem than Node.js alternatives
- - Limited to BEAM/Elixir runtime
Melhor Para
indie hacker startup
Alternativas
elixir erlang beam web middleware http websocket