-
-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make Http.middleware.withTracerDisabledWhen a Layer api (#2491)
- Loading branch information
Showing
4 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
"@effect/platform": minor | ||
--- | ||
|
||
make Http.middleware.withTracerDisabledWhen a Layer api | ||
|
||
And add Http.middleware.withTracerDisabledWhenEffect to operate on Effect's. | ||
|
||
Usage is now: | ||
|
||
```ts | ||
import * as Http from "@effect/platform/HttpServer"; | ||
|
||
Http.router.empty.pipe( | ||
Http.router.get("/health"), | ||
Http.server.serve(), | ||
Http.middleware.withTracerDisabledWhen( | ||
(request) => request.url === "/no-tracing", | ||
), | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
"@effect/platform": patch | ||
--- | ||
|
||
add Http.middleware.withTracerDisabledForUrls | ||
|
||
Allows you to disable the http server tracer for the given urls: | ||
|
||
```ts | ||
import * as Http from "@effect/platform/HttpServer"; | ||
|
||
Http.router.empty.pipe( | ||
Http.router.get("/health"), | ||
Http.server.serve(), | ||
Http.middleware.withTracerDisabledForUrls(["/health"]) | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters