Express represents a very thin layer on top of Node's HTTP server, but it has a few built-in objects that are important to become familiar with. These include the App
, Request
, Response
, and Router
objects. These objects, and a couple of plugins, provide all of the core functionality of the Express framework.
In Express, the app
object typically refers to the Express application. This is by convention and is the result of calling the express()
function. Open up your app.js
file and see the line that reads varapp=express()
. This is where we create our application and assign it to the variable app
. We could have used any variable name, but the convention is to use app
. We'll stick to convention and refer to this object as app
.
Let's take a closer look at our app.js
file and look at how we're already using the app
object:
var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require...