Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Phoenix Framework

Phoenix Framework

Overall view of Phoenix Framework.

Pedro Assumpcao

January 30, 2015
Tweet

More Decks by Pedro Assumpcao

Other Decks in Programming

Transcript

  1. • DEVELOPED WITH ELIXIR BY CHRIS MCCORD; • TOP LAYER

    OF A MULTI-LAYER: • PHOENIX; • PLUG (MIDDLEWARE); • COWBOY (HTTP SERVER). OVERVIEW
  2. • ROBUST ROUTING; • WEBSOCKET AND PUB/SUB LAYER; • PLUG-BASED

    ROUTES AND CONTROLLERS; • PRECOMPILED VIEW LAYER. FEATURES
  3. • DISTRIBUTED WEB SERVICES FRAMEWORK; • SIMPLIFY THE USE OF

    WEBSOCKETS, REAL TIME EVENTS AND SOA; • NO PRODUCTIVITY SACRIFICES FOR PERFORMANCE; • NO PERFORMANCES SACRIFICES FOR PRODUCTIVITY. GOALS
  4. • AFTER PHOENIX IS SET UP, A MIX TASK IS

    AVAILABLE TO CREATE APPS; • FETCH DEPENDENCIES; • COMPILE; • START SERVER. CREATING A NEW APP
  5. get “/pages/:slug”, PageController, :show # GET /pages/about # [“pages”, “about”]

    def match(conn, “GET”, [“pages”, slug]) do Controller.peform_action(conn, PageController, :show, slug: slug) end get “/files/*path”, FileController, :show # GET /files/Users/pedro/Documents # [“files”, “Users”, “pedro”, “Documents"] def match(conn, “GET”, [“files” | path]) do Controller.peform_action(conn, FileController, :show, path: path) end ROUTES
  6. • VIEWS SERVER AS A PRESENTATION LAYER; • VIEWS RENDER

    TEMPLATES; • TEMPLATES ARE PRECOMPILED INTO VIEWS; • EEX AND HAML ENGINE SUPPORT; VIEWS AND TEMPLATES
  7. # web/templates/layout/application.html.eex <html> ... <body> <%= @inner %> </body> </html>

    ! # web/templates/page/show.html.eex <p>This is the message: <%= message %></p> TEMPLATES