Change Type
Performance improvement
Current API
No middleware
We need:
- request logging
- rate limiting
- auth guard
- body size limit
- CORS
Proposed API
app.use(cors());
app.use(jwtAuth());
app.use(requestLogger());
Rationale
Currently, CORS is a separate method in the controller, which is not very convenient. In a modern framework, middleware is a must-have.
Migration Path
No response
Backward Compatibility
Potentially full Backward Compatibility.
Usage Examples
Change Type
Performance improvement
Current API
No middleware
We need:
Proposed API
Rationale
Currently, CORS is a separate method in the controller, which is not very convenient. In a modern framework, middleware is a must-have.
Migration Path
No response
Backward Compatibility
Potentially full Backward Compatibility.
Usage Examples