A quick reference for the app object's most commonly used properties, events, and methods.
Properties
| Property | Description |
|---|
app.locals | Application-wide local variables. |
app.mountpath | Path pattern(s) on which a sub-app is mounted. |
Events
| Event | Description |
|---|
mount | Fired on a sub-app when it's mounted on a parent app. |
Methods
| Method | Description |
|---|
app.all() | Routes all HTTP methods for a path to one handler. |
app.delete() | Routes DELETE requests. |
app.disable() | Sets a boolean setting to false. |
app.disabled() | Checks whether a setting is false. |
app.enable() | Sets a boolean setting to true. |
app.enabled() | Checks whether a setting is true. |
app.engine() | Registers a template engine. |
app.get() | Routes GET requests, or reads a setting when called with one argument. |
app.listen() | Starts the HTTP server on a host/port. |
app.METHOD() | Routes requests using the given lowercase HTTP method name. |
app.param() | Adds callback triggers to route parameters. |
app.path() | Returns the canonical path of the app. |
app.post() | Routes POST requests. |
app.put() | Routes PUT requests. |
app.render() | Renders a view's HTML via a callback. |
app.route() | Returns a chainable route instance for a path. |
app.set() | Assigns a value to an application setting. |
app.use() | Mounts middleware at a given path. |
Keep this table handy for quickly recalling a specific app property, event, or method.