Add application container, Gin router, graceful shutdown handler, and version endpoint. This establishes the skeleton for the WebDisk HTTP API as described in the architecture. - Add internal/app/WebApp for runtime dependencies and version - Add internal/server/router with GET /api/v1/version route - Add graceful shutdown runner with signal handling in cmd/serve - Add internal/api/ErrorResponse for standard HTTP error body - Update roadmap, architecture, and decisions documentation
21 lines
340 B
Go
21 lines
340 B
Go
package app
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/dhao2001/mygo/internal/config"
|
|
)
|
|
|
|
func TestNewWebApp(t *testing.T) {
|
|
cfg := &config.Config{}
|
|
|
|
webApp := NewWebApp(cfg)
|
|
|
|
if webApp.Config != cfg {
|
|
t.Fatal("Config was not assigned")
|
|
}
|
|
if webApp.Version != AppVersion {
|
|
t.Errorf("Version = %q, want %q", webApp.Version, AppVersion)
|
|
}
|
|
}
|