Skip to content

[API]: Refactor middleware logic #74

Description

@NikSimDev

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestinvalidThis doesn't seem right

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions