Phoenix
https://hexdocs.pm/phoenix/installation.html
Phoenix vs. Mix?
Phoenix: isA full-featured web development framework specifically for building web apps (with advanced real-time features like LiveView).
- Mix is just some build and project management ool
The basic idea of Plug is to unify the concept of a “connection” that we operate on.
Resources
- https://hexdocs.pm/phoenix/request_lifecycle.html
- Plugs https://hexdocs.pm/phoenix/plug.html
- Pipelines https://hexdocs.pm/phoenix/routing.html#pipelines
The core Phoenix components like endpoints, routers, and controllers are all just plugs internally.
- It’s an abstraction for connections
- The
_opts
is because you are not using that variable, so it’s normal to have an underscore for it
Pipelines
- There’s
:browser
, and there’s:api
There’s the
resources "/users", UserController
- This will kind of create a default
Routing
get "/", PageController, :home
This means that when a get request is received, it will be routed to the PageController
, calling the the home/2
function.