Files
tiennm99bot/internal/server/router.go
T
tiennm99 cf620a257e docs: fix stale code comments and add missing package docs
Correct comments that described the retired webhook transport, a removed
/cron route, the old KV store and wrapper types, and behaviour that has since
changed; drop plan and review labels; reword two startup log lines that
overstated or misnamed what they report.
2026-09-30 14:19:01 +07:00

23 lines
887 B
Go

// Package server is the bot's HTTP surface: a single health route for the
// container monitor, wrapped in structured request logging. Telegram updates
// and crons never arrive over HTTP.
package server
import "net/http"
// New builds the application's HTTP handler. The only route is:
//
// GET / → health (Coolify container monitor; not publicly routed)
//
// There is no /webhook route: Telegram updates arrive via long polling
// (cmd/server runs b.Start), so the bot needs no public inbound ingress.
// There is no /cron route either: crons fire from the in-process scheduler
// (internal/cron), so cron has no HTTP surface to expose or protect.
// Anything else is 404. All routes pass through LogRequests so every request
// emits a structured `req` log line.
func New() http.Handler {
mux := http.NewServeMux()
mux.Handle("/", HealthHandler())
return LogRequests(mux)
}