Swiftpack.co - TBXark/TrieRouter as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by TBXark.
TBXark/TrieRouter 1.3.3
Simple application routing framework
⭐️ 2
🕓 3 weeks ago
.package(url: "https://github.com/TBXark/TrieRouter.git", from: "1.3.3")

TrieRouter

An App-specific Simple Routing Library

Usage

let r = Router()
r.addRoute("tbx://index") { _ in
    print("root")
}
r.addRoute("tbx://intTest/:value") { ctx in
    let v = try ctx.params.getInt("value")
    print("hello \(v)")
}
r.addRoute("tbx://file/*name") { ctx in
    let name = try ctx.params.getString("name")
    print("file \(name)")
}
r.addRoute("tbx://long/long/:name/path") { ctx in
    let name = try ctx.params.getString("name")
    print("hello \(name)")
}

Requirements

Swift, iOS 8.0+, maxOS 10.10+

Installation

TrieRouter is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'TrieRouter'

Author

tbxark, tbxark@outlook.com

License

TrieRouter is available under the MIT license. See the LICENSE file for more info.

GitHub

link
Stars: 2
Last commit: 3 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

1.3.3
3 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics