feat: add HTTP handlers and health endpoint #12

Merged
AI-Manager merged 1 commits from feature/http-handlers into master 2026-03-26 05:05:02 +00:00
Owner

Summary

  • Implement all HTTP handlers from ROADMAP Phase 1.5 using Go 1.22+ ServeMux
  • Add HX-Request header detection for HTMX fragment vs full-page response
  • Include mobile-first dark theme base layout with bottom navigation bar
  • Refactor main.go to use centralized route registration
  • Add unit tests for health endpoint, dashboard, HTMX detection, input validation

Depends on: PR #11 (aggregation layer) -> PR #10 (config/auth)

Closes #4

Routes

Route Method Purpose
/health GET K8s probes
/ GET Dashboard / triage queue
/issues GET All issues across orgs
/pulls GET All PRs across orgs
/issues POST Create issue
/issues/{owner}/{repo}/{index}/labels POST Assign labels
/pulls/{owner}/{repo}/{index}/review POST Submit PR review

Test plan

  • Run go test ./internal/handlers/... to verify tests pass
  • Verify GET /health returns 200
  • Verify HTMX requests return fragments (no DOCTYPE)
  • Verify full-page requests include layout wrapper

Generated with Claude Code

## Summary - Implement all HTTP handlers from ROADMAP Phase 1.5 using Go 1.22+ ServeMux - Add HX-Request header detection for HTMX fragment vs full-page response - Include mobile-first dark theme base layout with bottom navigation bar - Refactor main.go to use centralized route registration - Add unit tests for health endpoint, dashboard, HTMX detection, input validation **Depends on:** PR #11 (aggregation layer) -> PR #10 (config/auth) Closes #4 ## Routes | Route | Method | Purpose | |-------|--------|---------| | `/health` | GET | K8s probes | | `/` | GET | Dashboard / triage queue | | `/issues` | GET | All issues across orgs | | `/pulls` | GET | All PRs across orgs | | `/issues` | POST | Create issue | | `/issues/{owner}/{repo}/{index}/labels` | POST | Assign labels | | `/pulls/{owner}/{repo}/{index}/review` | POST | Submit PR review | ## Test plan - [ ] Run `go test ./internal/handlers/...` to verify tests pass - [ ] Verify GET /health returns 200 - [ ] Verify HTMX requests return fragments (no DOCTYPE) - [ ] Verify full-page requests include layout wrapper Generated with Claude Code
AI-Manager changed target branch from feature/gitea-aggregation to master 2026-03-26 05:04:58 +00:00
AI-Manager added 1 commit 2026-03-26 05:04:58 +00:00
Implement all HTTP handlers using Go 1.22+ stdlib ServeMux with
HTMX fragment vs full-page response detection.

- internal/handlers/handlers.go: all route handlers
  - GET /health returns 200 for K8s probes
  - GET / dashboard with triage queue from aggregation layer
  - GET /issues lists all issues across orgs
  - GET /pulls lists all PRs across orgs
  - POST /issues creates issue via aggregation layer
  - POST /issues/{owner}/{repo}/{index}/labels assigns labels
  - POST /pulls/{owner}/{repo}/{index}/review submits PR review
  - HX-Request header detection for HTMX fragment vs full page
  - Mobile-first dark theme base layout with bottom navigation
- cmd/server/main.go: refactored to use centralized route registration
- internal/handlers/handlers_test.go: unit tests for health, dashboard,
  HTMX detection, input validation

Closes leeworks-agents/gitea-mobile#4

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AI-Manager merged commit 180fd9b65c into master 2026-03-26 05:05:02 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#12