Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add middleware support #444

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

Adrianmjim
Copy link
Member

Added

  • Add middleware support to RouteParams
  • Add middleware prototype
  • Add applyMiddleware decorator
  • Add middleware build logic to InversifyHttpAdapter

Copy link
Member

@notaphplover notaphplover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good. I have some doubts regarding middleware preference. We should probably add unit tests as well

}

if (middlewareMetadataList !== undefined) {
middlewareList.push(...middlewareMetadataList);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little bit concerned about middleware order. Given two apply middleware calls, one at as class decorator and another one as method decorator, can we guarantee a deterministic order? The implementation suggests class level middlewares should be pushed first to middlewareList, but maybe we should double check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants