lucky_router v0.6.0
LuckyRouter
A library for routing HTTP request with Crystal
Installation
Add this to your application's shard.yml
:
dependencies:
lucky_router:
github: luckyframework/lucky_router
Usage
require "lucky_router"
router = LuckyRouter::Matcher(Symbol).new
router.add("get", "/users", :index)
router.add("delete", "/users/:id", :delete)
router.match("get", "/users").payload # :index
router.match("get", "/users").params # {} of String => String
router.match("delete", "/users/1").payload # :delete
router.match("delete", "/users/1").params # {"id" => "1"}
router.match("get", "/missing_route").payload # nil
Contributing
- Fork it ( https://github.com/luckyframework/lucky_router/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Make your changes
- Run
./bin/test
to run the specs, build shards, and check formatting - Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- paulcsmith Paul Smith - creator, maintainer
Repository
lucky_router
Owner
Statistic
- 23
- 8
- 2
- 4
- 1
- about 1 month ago
- September 14, 2017
License
MIT License
Links
Synced at
Sat, 21 Dec 2024 17:46:28 GMT
Languages