{"id":22385310,"url":"https://github.com/acoshift/methodmux","last_synced_at":"2025-03-26T20:24:10.315Z","repository":{"id":57480558,"uuid":"125164863","full_name":"acoshift/methodmux","owner":"acoshift","description":"Method Multiplexer for http.ServeMux","archived":false,"fork":false,"pushed_at":"2018-03-14T16:54:20.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T02:20:23.342Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acoshift.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-14T06:18:30.000Z","updated_at":"2018-04-30T11:39:52.000Z","dependencies_parsed_at":"2022-09-26T17:41:16.710Z","dependency_job_id":null,"html_url":"https://github.com/acoshift/methodmux","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acoshift%2Fmethodmux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acoshift%2Fmethodmux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acoshift%2Fmethodmux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acoshift%2Fmethodmux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acoshift","download_url":"https://codeload.github.com/acoshift/methodmux/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245728907,"owners_count":20662770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-05T01:22:48.219Z","updated_at":"2025-03-26T20:24:10.282Z","avatar_url":"https://github.com/acoshift.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# methodmux\n\n[![Build Status](https://travis-ci.org/acoshift/methodmux.svg?branch=master)](https://travis-ci.org/acoshift/methodmux)\n[![Coverage Status](https://coveralls.io/repos/github/acoshift/methodmux/badge.svg?branch=master)](https://coveralls.io/github/acoshift/methodmux?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/acoshift/methodmux)](https://goreportcard.com/report/github.com/acoshift/methodmux)\n[![GoDoc](https://godoc.org/github.com/acoshift/methodmux?status.svg)](https://godoc.org/github.com/acoshift/methodmux)\n\nMethod Multiplexer for http.ServeMux\n\n## Example\n\n```go\npackage main\n\nimport (\n    \"io\"\n    \"net/http\"\n\n    \"github.com/acoshift/methodmux\"\n)\n\nfunc main() {\n    mux := http.NewServeMux()\n    mux.Handle(\"/\", methodmux.Get(http.HandlerFunc(index)))\n    mux.Handle(\"/about\", methodmux.Mux{\n        http.MethodGet:  http.HandlerFunc(aboutGet),\n        http.MethodPost: http.HandlerFunc(aboutPost),\n        \"\":              http.HandlerFunc(aboutOther),\n    })\n    http.ListenAndServe(\":8080\", mux)\n}\n\nfunc index(w http.ResponseWriter, r *http.Request) {\n    io.WriteString(w, \"Hello, Method Mux!\")\n}\n\nfunc aboutGet(w http.ResponseWriter, r *http.Request) {\n    io.WriteString(w, \"About Get\")\n}\n\nfunc aboutPost(w http.ResponseWriter, r *http.Request) {\n    io.WriteString(w, \"About Post\")\n}\n\nfunc aboutOther(w http.ResponseWriter, r *http.Request) {\n    io.WriteString(w, \"About does not support method \"+r.Method)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facoshift%2Fmethodmux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facoshift%2Fmethodmux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facoshift%2Fmethodmux/lists"}