Home / Function/ app() — express Function Reference

app() — express Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  303f26f5_2f7b_6b56_6b4d_11a03aa518a9["app()"]
  673d4de9_05d0_49fe_f1bf_9beb0280f850["index.js"]
  303f26f5_2f7b_6b56_6b4d_11a03aa518a9 -->|defined in| 673d4de9_05d0_49fe_f1bf_9beb0280f850
  style 303f26f5_2f7b_6b56_6b4d_11a03aa518a9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

examples/resource/index.js lines 13–26

app.resource = function(path, obj) {
  this.get(path, obj.index);
  this.get(path + '/:a..:b{.:format}', function(req, res){
    var a = parseInt(req.params.a, 10);
    var b = parseInt(req.params.b, 10);
    var format = req.params.format;
    obj.range(req, res, a, b, format);
  });
  this.get(path + '/:id', obj.show);
  this.delete(path + '/:id', function(req, res){
    var id = parseInt(req.params.id, 10);
    obj.destroy(req, res, id);
  });
};

Domain

Subdomains

Frequently Asked Questions

What does app() do?
app() is a function in the express codebase, defined in examples/resource/index.js.
Where is app() defined?
app() is defined in examples/resource/index.js at line 13.

Analyze Your Own Codebase

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

Try Supermodel Free