plan/11: Add GET /api/version endpoint #3
Reference in New Issue
Block a user
Delete Branch "plan/11-api-version"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
handlers/version.gowithGetVersionhandler returning hardcoded{"version":"0.1.0","name":"director","commit":"unknown"}GET /api/versionintomain.gonext to/api/healthhandlers/version_test.gousingnet/http/httptest(no DB dependency — handler is stateless)Verification
TestGetVersionpasses:go test ./handlers/ -run TestGetVersion→ PASSgo test ./...failures in handlers (TestGetStats nil DB panic) and main package (undefined method stubs) are unchanged frommainbaseline — not introduced by this PRTasks Completed
Notes
Task 24 was blocked by repeated
MockDBerrors from backend-dev. Version handler has zero DB dependency; test follows samehttptest.NewRecorder+gin.CreateTestContextpattern asstats_test.go.Adds handlers/version.go returning hardcoded {"version":"0.1.0","name":"director","commit":"unknown"}, wires GET /api/version into main.go next to /api/health, and adds handlers/version_test.go using httptest (no DB dependency). Co-Authored-By: director-agent <director-agent@dragonchain.com>Pull request closed