feat: implement GET /api/v1/domains and /api/v1/hostnames endpoints #76

Closed
clawbot wants to merge 1 commits from fix/67-readme-api-endpoints into main
Collaborator

Implement the two API endpoints documented in the README that were previously returning 404:

  • GET /api/v1/domains: Returns configured domains with their discovered nameservers, last check time, and status (ok/pending).
  • GET /api/v1/hostnames: Returns configured hostnames with per-nameserver DNS records, status, and last check time.

Both endpoints read from the existing state store and config, requiring no new dependencies. Nameserver results in the hostnames endpoint are sorted for deterministic output.

Changes:

  • internal/handlers/handlers.go: Added *state.State and *config.Config as dependencies via fx injection
  • internal/handlers/domains.go: New handler for GET /api/v1/domains
  • internal/handlers/hostnames.go: New handler for GET /api/v1/hostnames
  • internal/server/routes.go: Registered the two new routes

Closes #67

Implement the two API endpoints documented in the README that were previously returning 404: - **GET /api/v1/domains**: Returns configured domains with their discovered nameservers, last check time, and status (ok/pending). - **GET /api/v1/hostnames**: Returns configured hostnames with per-nameserver DNS records, status, and last check time. Both endpoints read from the existing state store and config, requiring no new dependencies. Nameserver results in the hostnames endpoint are sorted for deterministic output. Changes: - `internal/handlers/handlers.go`: Added `*state.State` and `*config.Config` as dependencies via fx injection - `internal/handlers/domains.go`: New handler for GET /api/v1/domains - `internal/handlers/hostnames.go`: New handler for GET /api/v1/hostnames - `internal/server/routes.go`: Registered the two new routes Closes #67
clawbot added 1 commit 2026-03-02 01:07:27 +01:00
feat: implement GET /api/v1/domains and /api/v1/hostnames endpoints
All checks were successful
check / check (push) Successful in 46s
83643f84ab
Implement the two API endpoints documented in the README that were
previously returning 404:

- GET /api/v1/domains: Returns configured domains with their
  discovered nameservers, last check time, and status (ok/pending).

- GET /api/v1/hostnames: Returns configured hostnames with
  per-nameserver DNS records, status, and last check time.

Both endpoints read from the existing state store and config,
requiring no new dependencies. Nameserver results in the hostnames
endpoint are sorted for deterministic output.

Closes #67
clawbot added the botneeds-review labels 2026-03-02 01:07:40 +01:00
Author
Collaborator

Closing as duplicate — PR #74 already addresses issue #67 by removing the undocumented endpoints from the README (reviewed and merge-ready). This PR takes the opposite approach (implementing them). Since #74 is already approved, deferring to that approach. If sneak wants the endpoints implemented instead, we can reopen this.

Closing as duplicate — PR #74 already addresses issue #67 by removing the undocumented endpoints from the README (reviewed and merge-ready). This PR takes the opposite approach (implementing them). Since #74 is already approved, deferring to that approach. If sneak wants the endpoints implemented instead, we can reopen this.
clawbot closed this pull request 2026-03-02 01:07:52 +01:00
All checks were successful
check / check (push) Successful in 46s
Required
Details

Pull request closed

Sign in to join this conversation.