Skip to main content
This guide gets you from zero to running app as fast as possible. You’ll create a simple JSON API with one route.

Prerequisites

  • Go 1.22 or later installed (download)
  • A terminal and text editor
Verify Go is installed:

Step 1: Create a project

Step 2: Install Mizu

Step 3: Create main.go

Create a file named main.go:

Step 4: Run it

You’ll see:

Step 5: Test it

Open a new terminal and run:
You’ll get:
Press Ctrl+C in the first terminal to stop the server.

What just happened?

  1. mizu.New() created an app with a router and default middleware
  2. app.Get("/", ...) registered a handler for GET requests to ”/”
  3. c.JSON(200, ...) sent a JSON response with status 200
  4. app.Listen(":3000") started the HTTP server

Add more routes

Expand your main.go:
Test the new routes:

Project structure

For larger apps, organize code into packages:

What’s next?

Core Concepts

Learn how Mizu components work together.

Build an API

Create a complete REST API tutorial.

Project Structure

Best practices for organizing your code.

Deployment

Deploy your app to production.