A Gentle Introduction to Express

Express.js is a node.js framework. It is used for writting scalable node.js applications.

Express has several key concepts.

Middlewares

Express.js can be referred to as a stack of middlewares. What then is a middlewares?

A middleware is a function that performs a specified task. Such task include:

  1. Make changes to request (req) or response (res).
  2. End the request response cycle.
  3. Call the next middleware.

Routing

Routing refers to assigning functions to respond to requests.

Format:

app.VERB(‘PATH’, CALLBACK);