Skip to content
Gasv0.6.0

Build SaaS backends in Go without rebuilding the wiring.

    Dependency injection, routing, middleware and a service lifecycle in the core. Add config, database, auth and more as modules, only when you need them.

    Get started
    main.go
    package main
    import (
    "context"
    "log"
    "net/http"
    "github.com/gasmod/gas"
    )
    func main() {
    app := gas.NewApp()
    app.Router().Handle(nil, http.MethodGet, "/", func(ctx gas.Context) error {
    return ctx.Text(http.StatusOK, "Hello, World!")
    })
    if err := app.Run(context.Background()); err != nil {
    log.Fatal(err)
    }
    }
    Terminal
    $ go run .
    INFO server started environment=development addr=0.0.0.0:8080
    $ curl localhost:8080
    Hello, World!

    One core, eleven modules

    Each module is its own Go module and registers as a service, like your own code. Most implement an interface the core defines, so your services depend on the interface, not the module.