raze
Version, currently 0.3.04 versions
- 0.3.0latestAug 27, 2018
- 0.2.1not indexedJan 2, 2021
- 0.2.0not indexedJan 2, 2021
- 0.1.0not indexedJan 2, 2021
github.com/samueleaton/raze
Modular, light web framework for Crystal
173 stars
3 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
raze:
github: samueleaton/raze
version: ~> 0.3.0Then run:
shards installshard.yml
- Crystal
0.26.0- License
- MIT
- Author
- Sam Eaton
- Target
razefrom src/raze.cr
Dependencies
Runtime Dependencies
README
Raze
Raze for days.
Installation
Add this to your application's shard.yml:
dependencies:
raze:
github: samueleaton/raze
Usage
require "raze"
get "/hello" do |ctx|
"hello, world!"
end
Raze.run
Raze takes a modular-first approach to middlewares
require "raze"
# Define middlewares
class Authenticator < Raze::Handler
def call(ctx, done)
puts "Authenticate here..."
done.call
end
end
class DDoSBlocker < Raze::Handler
def call(ctx, done)
puts "Prevent DDoS attack here..."
done.call
end
end
class UserFetcher < Raze::Handler
def call(ctx, done)
# Fetch user record from DB here...
ctx.state["user_name"] = "Sam"
done.call
end
end
# Define routes, attach middlewares
get "/api/**", [Authenticator.new, DDoSBlocker.new]
get "/api/user/:user_id", UserFetcher.new do |ctx|
"hello, #{ctx.state["user_name"]}!"
end
Raze.run
Contributing
- Fork it
- 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
TODO
Core
- [ ] Be able to run a stack of middlewares before the static file handler
- [ ] Remove all global scoping (e.g.
get "/"->Raze.get "/") - [ ] Live reload functionality for development
- [ ] Be able to define middlewares globally (for all routes)
Middlewares
- [ ] Urlencoded and JSON body parser
- [ ] Multipart/form-data body parser
- [ ] Static asset caching
- should take a cache time interval and be able to take a path match regex
- [ ] Route caching
- be able to cache the response for a route for a predetermined time interval
- [ ] Favicon caching
- [ ] CORS response header
- [ ] Access logger
- [ ] Session tracking
- [ ] Proxy middleware
- [ ] Security Headers
- e.g. Node's Helmet
Contributors
- Sam Eaton - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.3.0- Tagged
- Aug 27, 2018
- Commit
01b70846bc73- Crystal
0.26.0- Indexed
- yes
Dependents
Repository
github.com/samueleaton/raze
Metadata
- Created
- Aug 12, 2026
- Updated
- Sep 23, 2026
- Synced
- Sep 23, 2026
- Versions
- 4