Files
zeekay 1943f1c093 Hanzo Commerce
Multi-tenant commerce and billing: orders, subscriptions, invoices, plans,
usage metering and a credit ledger. One Go binary. MIT OR Apache-2.0.

Claude-Session: https://claude.ai/code/session_01SAtaDFm8VDiWrhYHNNtxMw
2026-09-23 21:52:16 -07:00

36 lines
600 B
Go

package middleware
import (
"github.com/zap-proto/zip"
"github.com/hanzoai/commerce/config"
"github.com/hanzoai/commerce/util/template"
)
var template503 = `
<html>
<head>
<style>
body {
font-family:monospace;
margin:20px;
}
</style>
</head>
<body>
<h4>503 Service Unavailable </h4>
<p>Service termporarily unvailable.</p>
</body>
</html>
`
// Serve custom 503 page.
func UnavailableHandler() zip.Handler {
return func(c *zip.Ctx) error {
if config.IsDevelopment {
return c.Bytes(503, []byte(template503))
}
return template.Render(c, "error/503.html")
}
}