How skufu/chirpy works
Project type and purpose
• This is a lightweight Go‑based HTTP server (a small “microservice” or open‑source tool) whose sole purpose is to serve static files and expose simple health, metrics, and reset endpoints.
File structure
• Top‑level Go files:
• main.go – application entrypoint that sets up the HTTP server and routes
• metrics.go – implements metricsHandler and middlewareMetricsInc
• reset.go – implements resetHandler
• readiness.go – implements readinessHandler
• Chirpy (binary output?) and out directory (build artifacts)
• assets/ and index.html – static assets root and default landing page
• go.mod – module definition for dependency management
• .gitignore – ignore rules
README for additional insights
• HTTP endpoints: /healthz, /metrics, /reset, /app/*
• Middleware pattern used to wrap the static file handler for counting
• Atomic counter in apiConfig holds server state (hit counter)
Detail without over‑splitting
• That middleware wraps only the /app/* handler
• A callout for Go’s net/http ServeMux as the central routing component