Category Archives: Node.js

REST API

REST API – Representational State Transfer Application Programming Interface http://www.restapitutorial.com/ HTTP Methods GET – to retrieve data from the server POST – to send data to the server PUT – to update data DELETE – to delete data getpostman.com – testing http … Continue reading

Posted in Node.js | Tagged , , , | Leave a comment

Event Emitter

Custom Event Emitters var EventEmitter = require(“events”).EventEmitter; var varName = new EventEmitter(); varName.on(“event“, function(param){ … }); Emit an Event varName.emit(“event“, “param“)

Posted in Node.js | Leave a comment

Module

OR OR

Posted in Node.js | Leave a comment

Express

Install npm install express –save Responding to Requests GET – app.get(‘route’, function(){…}) POST – app.post(‘route’, function(){…}) DELETE – app.delete(‘route’, function(){…}) Route OR  Route Params Template Engines ejs npm install ejs -save Template Engines Array Partial View Template Middleware Query Strings POST … Continue reading

Posted in Node.js | Leave a comment

Routing

Image | Posted on by | Leave a comment

Serving HTML & JSON

Serving HTML Page   Serving JSON Data

Posted in Node.js | Leave a comment

Streams

Readable streams – allows to read data from a stream Writable – allows to write data to a stream Duplex – can read and write to a stream Pipe

Posted in Node.js | Leave a comment