Generalize middlewares
See original GitHub issueMost of our middlewares could be more parametric.
- By expanding
HttpRoutes
withHttp[F, G]
, the same middleware can be applied to eitherHttpRoutes
orHttpApp
. - By expanding
Http[F, G]
to eitherKleisli[F, Request[G], B]
orKleisli[F, A, Response[G]]
, middleware that only affects one side can compose with Kleislis of different outputs or inputs. The latter is particularly helpful for applying the same middleware to both regular and authorized HTTP functions. - Increased parametricity makes it more clear what the middleware can do from the type alone.
This is a mostly mechanical translation, and would make a great first issue for anyone looking to better understand type classes and constraints. If you claim a middleware and offer to submit a PR, I will help you if you get stuck.
Server:
- AutoSlash.scala
- ChunkAggregator.scala
- CORS.scala
- CSRF.scala
- DefaultHead.scala
- EntityLimiter.scala
- GZip.scala
- HSTS.scala
- Jsonp.scala
- Logger.scala
- PushSupport.scala
- RequestLogger.scala
- ResponseLogger.scala
- Timeout.scala
- URITranslation.scala
- UrlFormLifter.scala
- VirtualHost.scala
Client:
- FollowRedirect.scala
- Logger.scala
- package.scala
- RequestLogger.scala
- ResponseLogger.scala
- Retry.scala
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Modules of Generalized Middleware and their Inter Modules of...
Our proposed LBS-Middleware acquires the features of generalized middleware such as interoperability, portability, scalability and so on. ... ... A reasonable ...
Read more >Generalizable Middleware to Support Use of REDCap ...
Although DDP is a standard module in REDCap, institutions must develop custom middleware web services to exchange data between REDCap …
Read more >A generalized approach to real-time, non-intrusive ...
Based on the questions above, we developed a generalized approach for non-intrusive instrumentation of distributed middleware. The approach is realized in a ...
Read more >A middleware for parallel generalized eigenvalue solvers to ...
An open-source middleware EigenKernel was developed for use with parallel generalized eigenvalue solvers or large-scale electronic state ...
Read more >Use specific middleware in Express for all paths except a ...
Is there a generalization of braided monoidal category without the isomorphism requirement? A robust version of "a holomorphic function is determined by its ......
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 FreeTop 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
Top GitHub Comments
Alright, then I think we’re done here.
I’m very happy about the response we got. Thanks to all who jumped in. We’ll try to make better use of the first-issue tag and continue this momentum with new contributors.
On further thought, I don’t think there’s anything to do on the client in the current design. The server ones are a function of Kleisli to Kleisli, and we can be generic in any of its three parameters. A
Client
only has one free parameter, and we’re already polymorphic on that.If we proceed with @ChristopherDavenport’s idea of a
Client
being just aKleisli
, then there’s something to do. Until then, I think we’re done here.Am I talking nonsense?