{"id":45436852,"url":"https://github.com/novrin/midway","last_synced_at":"2026-02-22T03:14:06.368Z","repository":{"id":215058113,"uuid":"736863795","full_name":"novrin/midway","owner":"novrin","description":"The Go package for arranging your HTTP middleware.","archived":false,"fork":false,"pushed_at":"2024-01-03T04:32:15.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-03T09:23:50.450Z","etag":null,"topics":["go","golang","golang-package","http-middleware","middleware"],"latest_commit_sha":null,"homepage":"","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/novrin.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}},"created_at":"2023-12-29T05:16:05.000Z","updated_at":"2024-01-02T07:00:19.000Z","dependencies_parsed_at":"2024-01-02T09:23:19.751Z","dependency_job_id":"6c0459d5-f2df-4dd3-a721-13990ba24755","html_url":"https://github.com/novrin/midway","commit_stats":null,"previous_names":["novrin/midway"],"tags_count":1,"template":null,"template_full_name":null,"purl":"pkg:github/novrin/midway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novrin%2Fmidway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novrin%2Fmidway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novrin%2Fmidway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novrin%2Fmidway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/novrin","download_url":"https://codeload.github.com/novrin/midway/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novrin%2Fmidway/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29704410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T23:35:04.139Z","status":"online","status_checked_at":"2026-02-22T02:00:08.193Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","golang","golang-package","http-middleware","middleware"],"created_at":"2026-02-22T03:14:05.862Z","updated_at":"2026-02-22T03:14:06.361Z","avatar_url":"https://github.com/novrin.png","language":"Go","readme":"# midway\n\n[![GoDoc](https://godoc.org/github.com/novrin/midway?status.svg)](https://pkg.go.dev/github.com/novrin/midway) \n![tests](https://github.com/novrin/midway/workflows/tests/badge.svg) \n[![Go Report Card](https://goreportcard.com/badge/github.com/novrin/midway)](https://goreportcard.com/report/github.com/novrin/midway)\n\n`midway` is a micro Go package for arranging your HTTP middleware.\n\n### Installation\n\n```shell\ngo get github.com/novrin/midway\n``` \n\n## Usage\n\nA `Queue` returns a `Middleware` where the slice of given middlewares are applied first-in-first-out. The last middleware in the slice will execute first.\n\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/novrin/midway\"\n)\n\nfunc main() {\n\t// Use Queue to arrange middleware to execute secureHeaders first.\n\tqueued := midway.Queue(corsHeaders, secureHeaders)\n\n\tapp := http.HandlerFunc(hello)\n\thttp.ListenAndServe(\":1313\", queued(app))\n\t// serves secureHeaders(corsHeaders(app))\n}\n```\n\nA `Stack` returns a `Middleware` where the slice of given middlewares are applied last-in-first-out. The first middleware in the slice will execute first.\n\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/novrin/midway\"\n)\n\nfunc main() {\n\t// Use Stack to arrange middleware to execute corsHeaders first.\n\tstacked := midway.Stack(corsHeaders, secureHeaders)\n\n\tapp := http.HandlerFunc(hello)\n\thttp.ListenAndServe(\":1313\", stacked(app))\n\t// serves corsHeaders(secureHeaders(app))\n}\n```\n\n## License\n\nCopyright (c) 2023-present [novrin](https://github.com/novrin)\n\nLicensed under [MIT License](./LICENSE)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovrin%2Fmidway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnovrin%2Fmidway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovrin%2Fmidway/lists"}