Skip to content

Go HTTP server skeleton with router and graceful shutdown #2

@tayebmokni

Description

@tayebmokni

Summary

Build the minimal Go HTTP server skeleton that boots, serves on a configurable port, and exposes a routable handler chain. This is the chassis subsequent issues mount handlers onto.

Design reference

  • docs/00-architecture-overview.md §4 (System Topology — Go API Server)
  • docs/00-architecture-overview.md §2 (Stack Decisions)

Acceptance criteria

  • cmd/server/main.go starts an HTTP server on a port read from env (default 8080)
  • Uses chi or stdlib net/http with a router; routes are registered in internal/http
  • Graceful shutdown on SIGINT/SIGTERM with a 10s timeout
  • Structured logging via slog with JSON output
  • GET / returns 200 with a JSON {"name":"gonext","version":"<commit>"} payload
  • Unit test verifies server starts, responds to root, and shuts down cleanly

Dependencies

#1

Complexity

S

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiGo HTTP API serverphase:P0-skeletonPhase 0 — Skeletonpriority:P0Critical — blocks the phaseskill:goGo programmingtype:featNew feature or implementation task

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions