{"id":13496747,"url":"https://github.com/mochidev/HostRouter","last_synced_at":"2025-03-28T19:30:57.343Z","repository":{"id":215763885,"uuid":"739728279","full_name":"mochidev/HostRouter","owner":"mochidev","description":"A Vapor middleware for including domains in routing","archived":false,"fork":false,"pushed_at":"2024-01-11T11:46:28.000Z","size":13,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T05:03:46.551Z","etag":null,"topics":["serverside-swift","swift","vapor"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/mochidev.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":"2024-01-06T11:12:14.000Z","updated_at":"2024-10-23T17:39:24.000Z","dependencies_parsed_at":"2024-01-11T13:35:33.910Z","dependency_job_id":null,"html_url":"https://github.com/mochidev/HostRouter","commit_stats":null,"previous_names":["mochidev/hostrouter"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochidev%2FHostRouter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochidev%2FHostRouter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochidev%2FHostRouter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochidev%2FHostRouter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mochidev","download_url":"https://codeload.github.com/mochidev/HostRouter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246088397,"owners_count":20721679,"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":["serverside-swift","swift","vapor"],"created_at":"2024-07-31T19:01:58.627Z","updated_at":"2025-03-28T19:30:57.086Z","avatar_url":"https://github.com/mochidev.png","language":"Swift","readme":"# HostRouter\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://swiftpackageindex.com/mochidev/HostRouter\"\u003e\n        \u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fmochidev%2FHostRouter%2Fbadge%3Ftype%3Dswift-versions\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://swiftpackageindex.com/mochidev/HostRouter\"\u003e\n        \u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fmochidev%2FHostRouter%2Fbadge%3Ftype%3Dplatforms\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/mochidev/HostRouter/actions?query=workflow%3A%22Test+HostRouter%22\"\u003e\n        \u003cimg src=\"https://github.com/mochidev/HostRouter/workflows/Test%20HostRouter/badge.svg\" alt=\"Test Status\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nA [Vapor](https://vapor.codes) middleware for including the domain in routing.\n\n## Quick Links\n\n- [Documentation](https://swiftpackageindex.com/mochidev/HostRouter/documentation)\n- [Updates on Mastodon](https://mastodon.social/tags/HostRouter)\n\n## Installation\n\nAdd `HostRouter` as a dependency in your `Package.swift` file to start using it. Then, add `import HostRouter` to any file you wish to use the library in.\n\nPlease check the [releases](https://github.com/mochidev/HostRouter/releases) for recommended versions.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/vapor/vapor.git\", from: \"4.90.0\"),\n    .package(url: \"https://github.com/mochidev/HostRouter.git\", .upToNextMinor(from: \"0.2.0\")),\n],\n...\ntargets: [\n    .executableTarget(\n        name: \"MyPackage\",\n        dependencies: [\n            .product(name: \"Vapor\", package: \"vapor\")\n            .product(name: \"HostRouter\", package: \"HostRouter\")\n        ]\n    )\n]\n```\n\n## What is `HostRouter`?\n\n`HostRouter` extends Vapor's routing capabilities by allowing you to include routes for the host domain along with the resource. This makes it easy to partition a domain running on a single server with dynamic routing for different users or services.\n\n`Host Router` was heavily inspired by by a [post](https://github.com/vapor/vapor/issues/2745#issuecomment-1450795410) by @andreasley on the Vapor repo, along with Vapor's own [`DefaultResponder`](https://github.com/vapor/vapor/blob/main/Sources/Vapor/Responder/DefaultResponder.swift).\n\n## Contributing\n\nContribution is welcome! Please take a look at the issues already available, or start a new discussion to propose a new feature. Although guarantees can't be made regarding feature requests, PRs that fit within the goals of the project and that have been discussed beforehand are more than welcome!\n\nPlease make sure that all submissions have clean commit histories, are well documented, and thoroughly tested. **Please rebase your PR** before submission rather than merge in `main`. Linear histories are required, so merge commits in PRs will not be accepted.\n\n## Support\n\nTo support this project, consider following [@dimitribouniol](https://mastodon.social/@dimitribouniol) on Mastodon, listening to Spencer and Dimitri on [Code Completion](https://mastodon.social/@codecompletion), or downloading Dimitri's wife Linh's app, [Not Phở](https://notpho.app/).\n","funding_links":[],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmochidev%2FHostRouter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmochidev%2FHostRouter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmochidev%2FHostRouter/lists"}