JSFoo 2012

It’s like kung fu with JavaScript and objects! All about building full size apps in JavaScript.

RESTful API Using Node.js With Express

Submitted by Ravindra (@ravidsrk) on Tuesday, 31 July 2012

Section: JavaScript Everywhere Technical level: Intermediate Session type: Tutorial

Abstract

  • Simple API design and pragmatic REST Web service, with only 2 base URLs per resource
  • Keep verbs out of your base URLs
  • Our HTTP verbs are POST, GET, PUT, and DELETE (Create, Read, Update, Delete)
  • Concrete names are better than abstract

Outline

JavaScript runs in so many applications, and since I already know JavaScript I would rather fiddle with Node.js than build an API for my local development needs in PHP or Ruby. Also, this excercise helps me to understand more about JSON, REST and Node.js.

Getting to know these technologies and developing solid skills using asynchronous behavior, necessary to build HTML5 apps for desktop and/or mobile browsers.

This talk came about as a desire to develop with a local API. Using a local API, I can develop a client application with Backbone.js and utilize the asynchronous behaviours that come with the API. I am not suggesting that anyone uses this tutorial to build a RESTful API for a production application. However, I do advocate developing with a local API rather then just mocking a server without asynchronous interations with JSON data. If you are not working with a RESTful API and are not consuming data using AJAX, in a few hours you can be.

Speaker bio

I am front end engineer from Cleartrip. Currently working on mobile apps for cleartrip. My previous experience was with creating hybrid mobile apps. Have worked on more than 20 hybrid apps.

Links

Comments

Login with Twitter or Google to leave a comment