Skip to main content
Mizu is made to feel natural for Go developers. It stays small, clear, and close to the standard library so you can build web applications confidently without learning a new framework language.

Clear routing

Routing follows Go 1.22 patterns and remains compatible with net/http. You can define routes by method and use {param} syntax for path parameters.
app.Get("/users/{id}", showUser)
app.Post("/users", createUser)
You can group routes or mix in any standard http.Handler when needed.

Simple request and response helpers

Each handler receives a *mizu.Ctx that makes it easy to read input and write responses.
id := c.Param("id")
return c.JSON(200, map[string]string{"id": id})
All operations are explicit, with no hidden globals, reflection, or magic.

Composable middleware

Middleware in Mizu is a simple function that wraps another handler. Use it for logging, authentication, recovery, or any shared behavior.
app.Use(func(next mizu.Handler) mizu.Handler {
	return func(c *mizu.Ctx) error {
		start := time.Now()
		err := next(c)
		c.Logger().Info("done", "took", time.Since(start))
		return err
	}
})

Structured logging

Mizu uses Go’s slog for structured logs. You can log request and response details anywhere in your code.
c.Logger().Info("handled request", "path", c.Request().URL.Path)
It supports color text output for development and JSON logs for production.

Graceful shutdown

Mizu automatically handles shutdown signals and waits for active requests to finish before stopping. You do not need extra code to handle cleanup or race conditions.

Static files and templates

You can serve static assets or HTML templates using built-in helpers.
app.Static("/assets/", http.Dir("public"))
For server-rendered pages, the mizu/render package integrates with Go’s html/template to make rendering simple and fast.

Streaming and real-time

Mizu supports streaming and real-time communication. You can send chunks of data or use Server-Sent Events with minimal setup.
return c.SSE(ch)

Config and CLI

Mizu supports configuration using .env, JSON, or YAML files. It includes a simple command-line tool for creating and running projects, helping you move quickly from idea to running code.

Small and extensible

Mizu is built from small, focused parts that can be extended easily. You can add your own packages or use standard libraries without losing simplicity or performance. Mizu lets you write web servers that look and feel like Go code. It stays clean, consistent, and easy to maintain over time.