Skip to content

Getting Started

Installation

Requires Go 1.25 or later.

bash
go get github.com/go-kruda/kruda

Quick Start

Create a main.go:

go
package main

import "github.com/go-kruda/kruda"

func main() {
    app := kruda.New()

    app.Get("/", func(c *kruda.Ctx) error {
        return c.JSON(map[string]string{
            "message": "Hello, Kruda!",
        })
    })

    app.Listen(":3000")
}

Run it:

bash
go run main.go

Visit http://localhost:3000 to see the response.

Configuration

Kruda uses the functional options pattern:

go
app := kruda.New(
    kruda.WithReadTimeout(30 * time.Second),
    kruda.WithWriteTimeout(30 * time.Second),
    kruda.WithBodyLimit(4 * 1024 * 1024), // 4MB
)

See Config API for all available options.

Next Steps

Released under the MIT License.