3. - Express.js is the most popular Node.js web application framework used
today
- Not enough experience to understand our needs
- Easy to jump in
Why did we choose ExpressJS?
12. ExpressJS: Clean Controller
problem of overusing
const controller = {
};
Data Validators
Access Control
Entity Loaders
Data Mappers
Business Logic
13. validator
middleware
entity loader access control data mapper controller
middleware middleware middleware middleware
ExpressJS: Clean Controller
cleaning out - short flow schema
14. - Load data from source (database)
- Modify request by assigning loaded data to access it from controller
ExpressJS: Clean Controller
cleaning out - entity loader schema
15. ExpressJS: Clean Controller
cleaning out - full flow schema
error error error
success success success success
errorerror
success
validator entity loader
access
control
data mapper controller
top level error handler
request response
17. ExpressJS: Clean Controller
cleaning out - using events
Event handler
Module A Module B Module C Controller
request response
“Background” functionality