express

Topics related to express:

Getting started with express

Routing

Error handling

Connect

express-generator

Express generator is a great tool for getting a project up and rolling quickly. Once you understand the organization it implements, it's a real time saver.

Explain Routing in Express

Handling static files

Writing Express Middleware

A middleware function is a function with access to the request object (req), the response object (res), and the next() middleware function in the application's request-response cycle. The next() middleware function is commonly denoted by a variable named next.

Middleware functions are designed to perform the following tasks:

  • Execute any code.
  • Make changes to the request and response objects. (See the requestTime example)
  • End the request-response cycle.
  • Call the next middleware in the stack. (By calling the next() middleware)

Note: It doesn't have to be named next. But if you use something else no one will know what you mean and you will be fired. And your code won't work. So, just name it next. This rule applies to the request and response object. Some people will use request and response instead of req and res, respectively. That's fine. It wastes keystrokes, but it's fine.

Express Database Integration

Logging

morgan is an HTTP request logger middleware for node.js

How does ExpressJs work

using https with express

View engine setup

install ejs using the following(I know it's obvious)

sudo npm install ejs --save