exports() — express Function Reference
Architecture documentation for the exports() function in index.js from the express codebase.
Entity Profile
Dependency Diagram
graph TD 0440e415_18ed_420a_3709_d12304568015["exports()"] 993f3e35_4d43_5344_325a_626a07e0ef64["index.js"] 0440e415_18ed_420a_3709_d12304568015 -->|defined in| 993f3e35_4d43_5344_325a_626a07e0ef64 style 0440e415_18ed_420a_3709_d12304568015 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
examples/mvc/controllers/user/index.js lines 11–22
exports.before = function(req, res, next){
var id = req.params.user_id;
if (!id) return next();
// pretend to query a database...
process.nextTick(function(){
req.user = db.users[id];
// cant find that user
if (!req.user) return next('route');
// found it, move on to the routes
next();
});
};
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does exports() do?
exports() is a function in the express codebase, defined in examples/mvc/controllers/user/index.js.
Where is exports() defined?
exports() is defined in examples/mvc/controllers/user/index.js at line 11.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free