refactor: serve static frontend with Go APIs

This commit is contained in:
2026-08-16 20:47:45 +08:00
parent 763d2f0648
commit b14b4fced7
101 changed files with 963 additions and 3928 deletions

View File

@@ -12,10 +12,10 @@ type routeMethodPattern struct {
allow []string
}
// WithRouteMethodCompatibility applies the method behavior that Next derives
// from app route exports. It sits outside authentication so OPTIONS never
// depends on runtime configuration and HEAD executes the corresponding GET
// semantics while suppressing the response body.
// WithRouteMethodCompatibility applies the legacy-compatible method matrix
// for the checked-in public HTTP contract. It sits outside authentication so
// OPTIONS never depends on runtime configuration and HEAD executes the
// corresponding GET semantics while suppressing the response body.
func WithRouteMethodCompatibility(next http.Handler) http.Handler {
patterns := routeMethodPatterns(GoRouteSurface())
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {