Setting and getting application options
An Express application has a set of predefined application variables that are used to configure various options of the app. These variables are used for setting various dynamic aspects of the app and can be set using the app.set()
method. So far we have used two of them:
app.set('view engine', 'jade'); app.set('views', './views');
The values of application variables can be retrieved using the corresponding app.get()
method.
The following table lists all the options that can be configured in an Express app:
Option |
Purpose |
---|---|
|
The environment the app is running on. Not recommended to set manually. You will read more about this in the next section. |
|
Enables reverse proxy. |
|
Callback name for JSONP requests. |
|
The JSON replacer callback. |
|
The amount of space for indenting JSON responses. |
|
Makes route names case-sensitive. |
|
Trailing slash at... |