
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@http4t/bidi
Advanced tools
NB: This is nowhere near production ready at time of writing.
I should be able to define a route at GET /widgets/{id}
and use that route to both:
HttpHandler
By sharing the routes between client and server I avoid bugs with my client sending the wrong shaped requests to my server.
If I have a route GET /widgets/{widgetId}
that returns a json-serialised response body containing a Widget
,
I want to be able to give my server a handler function that knows nothing about http, like:
(args: {widgetId: string}) => Promise<Widget>
...and have the server destructure the request into that shape and then serialise
the function result into an HttpResponse
.
On the client side, I want to be able to generate a function with the same signature
that takes care of serialising to an HttpRequest
, sending to an HttpHandler
, then
deserialising from HttpResponse
.
See client.test.ts for an example of a complete round trip from client to server and back.
FAQs
NB: This is nowhere near production ready at time of writing.
We found that @http4t/bidi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.