krout
Version, currently master branch1 version
- master branchlatestDec 16, 2016
github.com/faultyserver/krout
Simple routing extensions for Kemal.
Installation
# Add this to your shard.yml
dependencies:
krout:
github: faultyserver/krout
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.20.1- License
- MIT
- Author
- Jon
Dependencies
Development Dependencies
- kemal*github: kemalcr/kemal, branch: masterdev
README
krout
Routing extensions for Kemal.
Installation
Add this to your application's shard.yml:
dependencies:
krout:
github: faultyserver/krout
Usage
require "krout"
class Auth
def authenticate_user(env)
end
end
# Scope routes with a `scope` block
scope "/admin" do
# This becomes "/admin/dashboard".
get "/dashboard" do
"Hello"
end
# Filters are also scoped. This filter only applies to routes
# prefixed with "/admin".
before_get &->Auth.authenticate_user(Krout::Env)
end
See /examples/* for more detailed explanations of each feature.
Development
The goal of this project is to add small, common features to Kemal's routing DSL with as little overhead as possible. As such, it's scope is small, and larger features likely won't be included.
Each feature should be defined in it's own file under /src/krout (e.g., scope is defined in /src/krout/scope.cr). If a feature encapsulates multiple smaller features, consider creating a subfolder. Ideally, users will be able to selectively include the features they need (e.g., require "krout/scope" versus just require "krout").
Issues/PRs are welcome.
Contributing
- Fork it ( https://github.com/[your-github-name]/krout/fork )
- Create your feature branch (git checkout -b my-new-feature)
- 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
- faultyserver Jon - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Dec 16, 2016
- Crystal
0.20.1- Indexed
- yes
Dependents
Repository
github.com/faultyserver/krout
Metadata
- Created
- Aug 19, 2026
- Updated
- Oct 2, 2026
- Synced
- Oct 2, 2026
- Versions
- 1