Canonical Hanzo Go web framework. Sinatra-style API built on Fiber v3 / fasthttp. The ONE Go web framework — no .Fast escape hatch.
go get github.com/hanzoai/zippackage main
import "github.com/hanzoai/zip"
func main() {
app := zip.New()
app.Get("/", func(c zip.Ctx) error {
return c.SendString("hello world!")
})
app.Listen(":1337")
}zip is the canonical web framework every Hanzo Go service uses (iam, kms, gateway, commerce, base, cloud, ...). Built on Fiber v3 over fasthttp. Sinatra/Express-style primary API for fast prototyping, fasthttp-grade throughput in production.
Implements:
- HIP-0106 Unified Cloud Binary (web framework section)
Used by every subsystem listed in HIP-0106.
your handler -> zip.App -> Fiber v3 -> fasthttp -> net.Listener
|
+-- middlewares: identity strip/mint, JWT, CORS, rate-limit
+-- mount points for cloud subsystems (Mount(app, deps))
Zero parallel frameworks. No alternate Fast API. Same handler shape works in standalone services and inside the unified hanzoai/cloud binary.
A zippy web micro-framework. Just a tiny bit of sugar for Go's excellent
net/http package. Inspired by bottle, express, web.go, etc.
Zip can be installed with go get:
$ go get zeekay.io/zipA simple hello world web app looks like this:
package main
import "zeekay.io/zip"
func main() {
zip.Get("/", func(req zip.Req, res zip.Res) {
res.End("hello world!")
})
// Run and listen on port 1337.
zip.Run(":1337")
}You can run the server with go run:
$ go run hello.goThere are a few examples in examples/ for you to play with: