Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/werner/kemal-filters

Filters callback, similar to sinatra: http://www.sinatrarb.com/intro.html#Filters
https://github.com/werner/kemal-filters

Last synced: 7 days ago
JSON representation

Filters callback, similar to sinatra: http://www.sinatrarb.com/intro.html#Filters

Awesome Lists containing this project

README

        

## Disclaimer:
This shard has been merged in kemal itself.

# kemal-filters

Filters callback for Kemal, similar to sinatra: http://www.sinatrarb.com/intro.html#Filters

## Installation

Add this to your application's `shard.yml`:

```yaml
dependencies:
kemal-filters:
github: werner/kemal-filters
```

## Usage

```crystal
require "kemal"
require "kemal-filters"

add_filters

before "/home" do |env|
env.redirect "/other"
end

get "/home" do
"Hello World"
end

get "/other" do
"Other Page"
end
```

## Contributing

1. Fork it ( https://github.com/werner/kemal-filters/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request

## Contributors

- [werner](https://github.com/werner) Werner - creator, maintainer