The application, request, and response objects
Express presents three major objects that you'll frequently use. The application object is the instance of an Express application you created in the first example and is usually used to configure your application. The request object is a wrapper of Node's HTTP request object and is used to extract information about the currently handled HTTP request. The response object is a wrapper of Node's HTTP response object and is used to set the response data and headers.
The application object
The application object contains the following methods to help you configure your application:
app.set(name, value)
: This is used to set environment variables that Express will use in its configuration.app.get(name)
: This is used to get environment variables that Express is using in its configuration.app.engine(ext, callback)
: This is used to define a given template engine to render certain file types, for example, you can tell the EJS template engine...