added multiple method support for routes

This commit is contained in:
2026-01-24 14:44:38 +11:00
parent 1c49b19197
commit 2f49063432
4 changed files with 161 additions and 10 deletions

View File

@@ -74,6 +74,18 @@
// },
// }
//
// A single route can handle multiple HTTP methods using the Methods field:
//
// routes := []hws.Route{
// {
// Path: "/api/resource",
// Methods: []hws.Method{hws.MethodGET, hws.MethodPOST, hws.MethodPUT},
// Handler: http.HandlerFunc(resourceHandler),
// },
// }
//
// Note: The Methods field takes precedence over Method if both are provided.
//
// Path parameters can be accessed using r.PathValue():
//
// func getUser(w http.ResponseWriter, r *http.Request) {