Home / Function/ app() — express Function Reference

app() — express Function Reference

Architecture documentation for the app() function in application.js from the express codebase.

Entity Profile

Dependency Diagram

graph TD
  b2653af8_e58e_4462_6d30_af9c4a06e471["app()"]
  43601c42_126e_f8a7_ae10_39339f46382e["application.js"]
  b2653af8_e58e_4462_6d30_af9c4a06e471 -->|defined in| 43601c42_126e_f8a7_ae10_39339f46382e
  ecfbc583_ff51_1d79_5741_f58cba9feff3["tryRender()"]
  b2653af8_e58e_4462_6d30_af9c4a06e471 -->|calls| ecfbc583_ff51_1d79_5741_f58cba9feff3
  style b2653af8_e58e_4462_6d30_af9c4a06e471 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

lib/application.js lines 59–83

app.init = function init() {
  var router = null;

  this.cache = Object.create(null);
  this.engines = Object.create(null);
  this.settings = Object.create(null);

  this.defaultConfiguration();

  // Setup getting to lazily add base router
  Object.defineProperty(this, 'router', {
    configurable: true,
    enumerable: true,
    get: function getrouter() {
      if (router === null) {
        router = new Router({
          caseSensitive: this.enabled('case sensitive routing'),
          strict: this.enabled('strict routing')
        });
      }

      return router;
    }
  });
};

Domain

Subdomains

Defined In

Calls

Frequently Asked Questions

What does app() do?
app() is a function in the express codebase, defined in lib/application.js.
Where is app() defined?
app() is defined in lib/application.js at line 59.
What does app() call?
app() calls 1 function(s): tryRender.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free