refactor: serve static frontend with Go APIs
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user