{"id":15373175,"url":"https://github.com/otiai10/marmoset","last_synced_at":"2025-04-15T11:32:15.977Z","repository":{"id":47508957,"uuid":"50010262","full_name":"otiai10/marmoset","owner":"otiai10","description":"The very minimum web toolkit, less than framework","archived":false,"fork":false,"pushed_at":"2024-10-04T23:13:15.000Z","size":61,"stargazers_count":11,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-01T10:42:20.671Z","etag":null,"topics":["go","http-router","http-server"],"latest_commit_sha":null,"homepage":"https://github.com/otiai10/marmoset-example","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/otiai10.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-20T06:40:46.000Z","updated_at":"2024-08-07T10:37:14.000Z","dependencies_parsed_at":"2024-07-25T03:07:58.753Z","dependency_job_id":null,"html_url":"https://github.com/otiai10/marmoset","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otiai10%2Fmarmoset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otiai10%2Fmarmoset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otiai10%2Fmarmoset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otiai10%2Fmarmoset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/otiai10","download_url":"https://codeload.github.com/otiai10/marmoset/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223673048,"owners_count":17183618,"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":["go","http-router","http-server"],"created_at":"2024-10-01T13:54:26.544Z","updated_at":"2024-11-08T11:01:53.642Z","avatar_url":"https://github.com/otiai10.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"marmoset\n========\n\n[![Go](https://github.com/otiai10/marmoset/actions/workflows/go.yml/badge.svg)](https://github.com/otiai10/marmoset/actions/workflows/go.yml)\n[![codecov](https://codecov.io/gh/otiai10/marmoset/branch/main/graph/badge.svg?token=jQrl6xAFNa)](https://codecov.io/gh/otiai10/marmoset)\n[![Go Report Card](https://goreportcard.com/badge/github.com/otiai10/marmoset)](https://goreportcard.com/report/github.com/otiai10/marmoset)\n[![Maintainability](https://api.codeclimate.com/v1/badges/ba1ab060a31d7ff00c8a/maintainability)](https://codeclimate.com/github/otiai10/marmoset/maintainability)\n[![GoDoc](https://godoc.org/github.com/otiai10/marmoset?status.svg)](https://godoc.org/github.com/otiai10/marmoset)\n\nless than \"web framework\", just make your code a bit DRY.\n\n```go\nfunc main() {\n\trouter := marmoset.NewRouter()\n\trouter.GET(\"/hello\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte(\"hello!\"))\n\t})\n\thttp.ListenAndServe(\":8080\", router)\n}\n```\n\n# Features\n\n- Path parameters\n- Static directory\n- Request filters\n\t- Request-Context accessor, if you want\n\n```go\nfunc main() {\n\n\trouter := marmoset.NewRouter()\n\n\trouter.GET(\"/foo\", your.FooHttpHandlerFunc)\n\trouter.POST(\"/bar\", your.BarHttpHandlerFunc)\n\n\t// Path parameters available with regex like declaration\n\trouter.GET(\"/users/(?P\u003cname\u003e[a-zA-Z0-9]+)/hello\", func(w http.ResponseWriter, r *http.Request) {\n\t\tmarmoset.Render(w).HTML(\"hello\", map[string]string{\n\t\t\t// Path parameters can be accessed by req.FromValue()\n\t\t\t\"message\": fmt.Printf(\"Hello, %s!\", r.FormValue(\"name\")),\n\t\t})\n\t})\n\n\t// Set static file path\n\trouter.Static(\"/public\", \"/your/assets/path\")\n\n\t// Last added filter will be called first.\n\tserver := marmoset.NewFilter(router).\n\t\tAdd(\u0026your.Filter{}).\n\t\tAdd(\u0026your.AnotherFilter{}).\n\t\tAdd(\u0026marmoset.ContextFilter{}). // if you want\n\t\tServer()\n\n\thttp.ListenAndServe(\":8080\", server)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotiai10%2Fmarmoset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotiai10%2Fmarmoset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotiai10%2Fmarmoset/lists"}