mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-07-27 20:19:50 +00:00
The in-process scheduler is the sole cron trigger on self-host, so the
/cron/{name} HTTP endpoint and its CRON_SHARED_SECRET are dead surface.
Reduce the HTTP server to GET / (health) and remove the cron secret config,
SSM binding, and now-unused timeout.
20 lines
697 B
Go
20 lines
697 B
Go
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)
|
|
}
|