
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.
zgo.at/zhttp/ctxkey
Martin's HTTP package: It's not a "framework", but just a collection of functions for building HTTP services.
Convention over configuration. Honestly, I'm not sure how useful this will be for other people at this stage (or ever), but it's pretty useful for me.
zhttp.Wrap()
allows returning errors from HTTP endpoints:
http.HandleFunc("/bar", zhttp.Wrap(func(w http.ResponseWriter, r *http.Request) error {
d, err := getData()
if err != nil {
return err
}
return zhttp.String("Hello, %s", d)
}))
It's just more convenient than http.Error(...)
followed by a return
. The
ErrFunc()
will be used to report returned errors (you can override it if you
need to).
Return helpers:
zhttp.String()
zhttp.JSON()
zhttp.Template()
zhttp.SeeOther()
zhttp.Decode()
scans forms, JSON body, or URL query parameters in to a struct.
It's just a convencience wrapper around formam.
zhttp.HostRoute()
routes request to chi routers based on the Host header.
FAQs
Unknown package
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.