Make middleware depends on context
See original GitHub issueHi!
I have middleware that prefetch async data for further react rendering and it’s rely on some flags.
So that flags can be uniq for each request on server side, what means that I need something like context in middleware for each router.start(url)
. Or put middleware function on each router.start instead of applying it once on router creation.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
node.js - How to use 'this' context in middleware - Stack Overflow
There are several techniques to bind the context, You can use apply, call, a closure, or the easier new ES6 arrow functions. This...
Read more >Conditional Middleware based on request in ASP.NET Core
This post looks at how to configure ASP.NET Core middleware in a way that allows you to have different middleware for different types...
Read more >ASP.NET Core Middleware | Microsoft Learn
Create a middleware pipeline with WebApplication ... Use(async (context, next) => { // Do work that can write to the Response. await next....
Read more >Using immutable event and context changes in middleware
In my opinion it would make a lot of sense if middleware called next with optional event and context parameters that are then...
Read more >Custom middleware with dependency injection in ASP.NET ...
Inversion of control container. We'll use this object to create instances of classes required by the middleware. IDictionary<string, object> ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
End of the month is what I’m aiming for. I have two weeks holiday starting tomorrow, and during the 2nd week I’ll be able to focus on it a lot more.
It is preferable. Since it’s not stateless, you can’t allow a single instance to be accessed by multiple requests.