Files
expressjs.com/_includes/api/en/4x/app.md
Douglas Christopher Wilson faa6bb9e0a Apply StandardJS style to API docs
2019-05-26 22:47:09 -04:00

2.7 KiB

Application

The app object conventionally denotes the Express application. Create it by calling the top-level express() function exported by the Express module:

var express = require('express')
var app = express()

app.get('/', function (req, res) {
  res.send('hello world')
})

app.listen(3000)

The app object has methods for

It also has settings (properties) that affect how the application behaves; for more information, see Application settings.

The Express application object can be referred from the [request object](#req) and the [response object](#res) as `req.app`, and `res.app`, respectively.

Properties

{% include api/en/4x/app-locals.md %}
{% include api/en/4x/app-mountpath.md %}

Events

{% include api/en/4x/app-onmount.md %}

Methods

{% include api/en/4x/app-all.md %}
{% include api/en/4x/app-delete-method.md %}
{% include api/en/4x/app-disable.md %}
{% include api/en/4x/app-disabled.md %}
{% include api/en/4x/app-enable.md %}
{% include api/en/4x/app-enabled.md %}
{% include api/en/4x/app-engine.md %}
{% include api/en/4x/app-get.md %}
{% include api/en/4x/app-get-method.md %}
{% include api/en/4x/app-listen.md %}
{% include api/en/4x/app-METHOD.md %}
{% include api/en/4x/app-param.md %}
{% include api/en/4x/app-path.md %}
{% include api/en/4x/app-post-method.md %}
{% include api/en/4x/app-put-method.md %}
{% include api/en/4x/app-render.md %}
{% include api/en/4x/app-route.md %}
{% include api/en/4x/app-set.md %}
{% include api/en/4x/app-use.md %}