test: add reverse proxy deployment check

This commit is contained in:
2026-09-22 15:06:17 +08:00
parent b7dc36fc99
commit 30fdad44c2
5 changed files with 246 additions and 1 deletions

View File

@@ -181,6 +181,16 @@ func serve(adapter string, tlsEnabled bool) error {
application.GET("/health", func(c *omni.Context) error {
return c.OK(map[string]string{"status": "ok"})
})
application.GET("/slow", func(c *omni.Context) error {
timer := time.NewTimer(2 * time.Second)
defer timer.Stop()
select {
case <-timer.C:
return c.OK(map[string]string{"status": "slow"})
case <-c.Context().Done():
return c.Context().Err()
}
})
done := make(chan error, 1)
var shutdown func(context.Context) error
switch adapter {