HostRouter

0.2.0

A Vapor middleware for including domains in routing
mochidev/HostRouter

What's New

Version 0.2.0

2024-01-11T11:46:28Z

What's Changed

Full Changelog: 0.1.2...0.2.0

HostRouter

Test Status

A Vapor middleware for including the domain in routing.

Quick Links

Installation

Add 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.

Please check the releases for recommended versions.

dependencies: [
    .package(url: "https://github.com/vapor/vapor.git", from: "4.90.0"),
    .package(url: "https://github.com/mochidev/HostRouter.git", .upToNextMinor(from: "0.2.0")),
],
...
targets: [
    .executableTarget(
        name: "MyPackage",
        dependencies: [
            .product(name: "Vapor", package: "vapor")
            .product(name: "HostRouter", package: "HostRouter")
        ]
    )
]

What is HostRouter?

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.

Host Router was heavily inspired by by a post by @andreasley on the Vapor repo, along with Vapor's own DefaultResponder.

Contributing

Contribution 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!

Please 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.

Support

To support this project, consider following @dimitribouniol on Mastodon, listening to Spencer and Dimitri on Code Completion, or downloading Dimitri's wife Linh's app, Not Phở.

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Thu May 02 2024 21:49:42 GMT-0900 (Hawaii-Aleutian Daylight Time)