Multiple Servers

Run multiple Lokstra servers concurrently in the same application.

Running

go run main.go

Three servers will start:

Architecture

func main() {
    var wg sync.WaitGroup
    
    // Start multiple servers
    wg.Add(1)
    go func() {
        defer wg.Done()
        apiApp.Run(0)
    }()
    
    wg.Add(1)
    go func() {
        defer wg.Done()
        adminApp.Run(0)
    }()
    
    wg.Wait()
}

Servers

API Server (3080)

Business logic endpoints:

Admin Server (3081)

Administrative endpoints:

Metrics Server (3082)

Monitoring endpoints:

Use Cases