cradix v1.0.0

A simple radix like url path router in crystal lang

Cradix

A simple radix like tree specialized in URL path routing with supports for wildcards, in crystal lang.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      cradix:
        github: globoplox/cradix
    
  2. 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/self", "Get the current login in user"
puts radix.search("/users/toto").first # => {"Get a user by id", {"id" => "toto"}}
puts radix.search("/users/self").first # => {"Get the current login in user", {}}
Repository

cradix

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • 9 months ago
  • March 26, 2024
License

MIT License

Links
Synced at

Mon, 23 Dec 2024 00:34:51 GMT

Languages