PhoenixElixir Web 框架
Phoenix 是函數(shù)式編程語言 Elixir 的 Web 開發(fā)框架。要求 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
評論
圖片
表情
