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

API + Static Clients

API + Static Clients

Our thoughts about our departure from traditional Web development approaches in favor of static HTML5 and Javascript clients combined with RESTful JSON APIs.

Ronan Berder

January 26, 2013
Tweet

More Decks by Ronan Berder

Other Decks in Technology

Transcript

  1. Use cases • Static blog (Github pages) with dynamic data

    beyond comments. • Multiple clients (Web, mobile, tablet) with a single service.
  2. How to get around it • CORS: • Allow anything

    from anywhere... • Have the clients registered.
  3. How to get around it • Session • Require CORS

    credentials being sent and manage sessions regularly • Manage sessions in a different way.
  4. Session • Express + connect-redis • Passport (http://passportjs.org/) • Either

    • app.use(passport.session()); • passport-http-bearer
  5. CORS & Session • Hard work is done on the

    server • A bit of configuration • Lots of Javascript: need solid tools
  6. Feels right • More versatile • More isolation: • Simpler

    to prototype • Easier to maintain and re-use • Easier to secure • Better performances...