Phoenix是函数式编程语言Elixir的Web开发框架。要求Elixirv1.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 endend
评论