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 to Readme: the order in which middleware is defined matters #936

Open
kkrell2016 opened this issue Nov 30, 2022 · 1 comment
Open

Add to Readme: the order in which middleware is defined matters #936

kkrell2016 opened this issue Nov 30, 2022 · 1 comment
Assignees

Comments

@kkrell2016
Copy link

This is a suggestion rather than a bug or problem.

The readme should point out that the order in which middleware is defined also controls the order in which it is executed. It is also possible to call a middleware more than once.

I don't know if this is intentional, but it cost me some nerves :) I struggled with sanitation and validation for example. But there are some great options as well.

I haven't tried it yet, but this way you could probably control the reconnect middleware better because you get more parameters in other handlers. There were some questions here about that.

So long story short, if its by intentional I think it should be mentioned in the docu as well.

@mevdschee
Copy link
Owner

Hi @kkrell2016, thank you for opening this issue.

The readme should point out that the order in which middleware is defined also controls the order in which it is executed.

Agree.

It is also possible to call a middleware more than once.

I would not recommend to do that.

So long story short, if its by intentional ...

Yes, it is intentional.

I think it should be mentioned in the docu as well.

Can you propose an addition to the documentation that makes this clear?

Kindest regards, Maurits

@mevdschee mevdschee self-assigned this Nov 30, 2022
@mevdschee mevdschee changed the title Suggestion for Info in Readme Add to Readme: the order in which middleware is defined matters Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants