When to Use This Template
Use the minimal template when:- Learning Mizu - Understand the basics without distractions
- Quick experiments - Test an idea in minutes
- Custom structure - You want to build your own project layout
- Embedding examples - Need a simple example to share
What You Get
A single-file application with:- One Go file (
main.go) - A basic route that returns “Hello”
- A running server on port 8080
Quick Start
http://localhost:8080 in your browser. You’ll see:
What the Code Looks Like
The entire application fits in one file:- Create the app -
mizu.New()creates a new Mizu application - Add a route -
app.Get("/", ...)handles GET requests to the root path - Return a response -
c.Text(200, "...")sends a plain text response - Start the server -
app.Listen(":8080")starts the HTTP server
Why Start Minimal?
Easy to Understand
With just 20 lines of code, you can see exactly what Mizu does:- Creates an HTTP server
- Routes requests to handlers
- Sends responses
Easy to Modify
Want to try something? Just edit the one file:Easy to Grow
When you’re ready for more structure, you can:- Add new files to the same directory
- Migrate to the
apitemplate - Build your own custom structure
Comparison with Other Templates
| Aspect | minimal | api |
|---|---|---|
| Files | 1 | 10+ |
| Folders | 0 | 5+ |
| Lines of code | ~20 | ~200 |
| Learning curve | Minutes | Hours |
| Production ready | No | Yes |
When to Upgrade
Consider switching to theapi template when:
- You have more than 3-4 routes
- You need configuration management
- Multiple developers are working on the project
- You want feature-based organization