Create HttpApp and HttpRoutes Defaults for Server Middleware
See original GitHub issueServer Middleware that is defined on Http[F, G] can sometimes be hard to reason about for folks who are trying to get a handle on the Http process. Rather than forcing individuals to learn Kleisli Composition, and FunctionK, we can create function which summon that middleware on HttpRoutes, or HttpApp respectively with OptionT.liftK
and FunctionK.id
. As its just a default argument being plugged in, but will make the middleware far more approachable without losing any of the composition the get Http types give us.
So each middleware would get on that take and HttpRoutes[F]
, and an HttpApp[F]
, preferably names def httpRoutes
and def httpApp
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Service - http4s
This tutorial will walk you through creating your first http4s service and calling it with http4s' client. Create a new directory, with the...
Read more >http4s/http4s - Gitter
I talk about this in my presentation at NE Scala. I guess we need to get a distilled version on the site. Remember...
Read more >org.http4s.server.Router Scala Example - ProgramCreek.com
This page shows Scala examples of org.http4s.server. ... Root as user using traceId => Created(user -> traceId) } lazy val authMiddleware: AuthMiddleware[F, ...
Read more >Natchez HTTP4s - OvoTech
natchez-extras-http4s provides HTTP4s Middleware to trace all HTTP requests. ... To use Natchez HTTP4s you create an HttpApp[Kleisli[F, Span[F], ...
Read more >Running http4s server with ZIO Env - scala - Stack Overflow
Router import org.http4s.server.middleware. ... _ val httpApp: HttpApp[AppTask] = Router[AppTask]( ... /tmp/http4s/build.sbt.
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
Apologies, I’ve been drowning in notifications.
MonoidK
.So, yeah, 👍.
In https://github.com/http4s/http4s/pull/6629 I took a different approach of adding a
Lift
type class that provides theFunctionK
instance. That pull request also deprecates thehttpApp
/httpRoutes
constructors - do people feel strongly about havinghttpApp
andhttpRoutes
constructors in addition?