cradix
Version, currently 1.1.02 versions
- 1.1.0latestFeb 11, 2025
- 1.0.0not indexedFeb 11, 2025
github.com/globoplox/cradix
A simple radix like url path router in crystal lang
1 stars
1 dependent
License: MIT
Installation
# Add this to your shard.yml
dependencies:
cradix:
github: globoplox/cradix
version: ~> 1.1.0Then run:
shards installshard.yml
- Crystal
>= 1.11.2- License
- MIT
- Author
- globoplox
Dependencies
This version declares no dependencies.
README
Cradix
A simple radix like tree specialized in URL path routing with supports for path parameters and wildcards, in crystal lang.
Installation
-
Add the dependency to your
shard.yml:dependencies: cradix: github: globoplox/cradix -
Run
shards install
Usage
require "cradix"
radix = Cradix(String).new
radix.add "/users", "List users"
radix.add "/users/:id", "Get a user by id"
radix.add "/users/:id/file/*", "Get a user file by path"
radix.add "/users/self", "Get the current login in user"
puts radix.search("/users/toto").first # => {"Get a user by id", {"id" => "toto"}, nil}
puts radix.search("/users/self").first # => {"Get the current login in user", {}, nil}
puts radix.search("/users/toto/file/holiday/beach.raw").first # => {"Get a user file by path", {"id" => "toto"}, "/holiday/beach.raw"}
Changelog
[1.1.0] - 2025-02-11
Added
- Support for wildcard (in addition to existing support of path parameters)
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.1.0- Tagged
- Feb 11, 2025
- Commit
39f8418843a8- Crystal
>= 1.11.2- Indexed
- yes
Dependents
Repository
github.com/globoplox/cradix
Metadata
- Created
- Aug 19, 2026
- Updated
- Nov 12, 2026
- Synced
- Nov 12, 2026
- Versions
- 2