Skip to content

feat(api): fundação da API Go com endpoint de saúde - #2

Merged
eduardoaugustolb merged 5 commits into
mainfrom
feat/api-foundation
Aug 4, 2026
Merged

feat(api): fundação da API Go com endpoint de saúde#2
eduardoaugustolb merged 5 commits into
mainfrom
feat/api-foundation

Conversation

@eduardoaugustolb

@eduardoaugustolb eduardoaugustolb commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Resumo

  • API Go mínima seguindo Clean Architecture + Hexagonal Architecture (Ports & Adapters): caso de uso health.CheckHealth, adapter HTTP em internal/transport/httpapi (chi) e composition root em cmd/api.
  • internal/config carrega PORT/ENVIRONMENT via lookup injetável, com defaults (:8080, development) e validação de faixa de porta (1–65535).
  • GET /health responde 200 com {"status":"ok"}.
  • Plano Plans/Active/01 - Fundação da API Go arquivado em Plans/Archive/, já que as 4 etapas estão implementadas e verdes.

Test plan

  • go build ./...
  • go vet ./...
  • gofmt -l . sem saída
  • go test ./...
  • go run ./cmd/api + curl -i http://localhost:8080/health200, Content-Type: application/json, {"status":"ok"}
  • cd tools/vaultlint && go run . -root "../../Obsidian Vault"vault lint passed

Adds internal/transport/httpapi with a chi router that adapts
health.CheckHealth to GET /health, translating Status into JSON
without leaking domain rules into the handler.
Wires config.Load, health.CheckHealth and httpapi.NewRouter in
cmd/api/main.go. Configuration failures log via slog and exit 1;
http.ErrServerClosed is treated as an expected shutdown instead of
a crash.
As 4 etapas de Plans/Active/01 estão implementadas e verdes
(go build, go vet, go test, curl em /health). Move o plano para
Plans/Archive, atualiza os índices e corrige um link e um
subsection incorretos que já existiam em Plans/Archive/02.
@eduardoaugustolb
eduardoaugustolb merged commit ce7ccee into main Aug 4, 2026
1 check passed
@eduardoaugustolb
eduardoaugustolb deleted the feat/api-foundation branch August 4, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant