Phoenix 是函数式编程语言 Elixir 的 Web 开发框架。要求 Elixir v1.0.2+
示例代码:
defmodule MyApp.Router do use Phoenix.Router pipeline :browser do plug :accepts, ~w(html) plug :fetch_session end pipeline :api do plug :accepts, ~w(json) end scope "/", alias: MyApp do pipe_through :browser get "/pages/:page", PageController, :show get "/files/*path", FileController, :show resources "/users", UserController do resources "/comments", CommentController end end scope "/api", alias: MyApp.Api do pipe_through :api resources "/users", UserController end end