Files
zeekayandHanzo Dev f61a1d0df1 One handler at two addresses is two registrations
Alias existed for one reason, stated in its own doc: a registration made inside
a helper is invisible to cmd/zipdoc, so a service that rolled its own alias
helper lost the prose for both addresses. That is no longer true — the pass
reads Raw on a route table directly, and a fixture now proves two plain Raw
calls each carry the handler's sentence.

So the abstraction was working around a limitation that no longer exists, and
nothing in the estate called it. It goes, with the thirty-odd lines of extractor
special case that recognised it.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-17 15:39:18 -07:00

18 lines
508 B
Go

// Package twoaddr registers one handler at two addresses with two plain Raw
// calls, which is how one handler answers at two addresses.
package twoaddr
import "github.com/zap-proto/zip"
//go:generate zipdoc
// Remind sends the invoice reminder.
func Remind(c *zip.Ctx) error { return c.NoContent(204) }
// Register declares both spellings.
func Register(app *zip.App) {
g := app.Group("/v1/billing")
g.Raw("POST", "/invoices/:id/reminders", Remind)
g.Raw("POST", "/send-invoice-reminder", Remind)
}