route.cr alternatives and similar shards
Based on the "HTTP" category.
Alternatively, view route.cr alternatives based on common mentions on social networks and blogs.
crest9.5 6.2 route.cr VS crestHTTP and REST client for Crystal
halite9.2 1.0 route.cr VS halite💎HTTP Requests Client with a chainable REST API, built-in sessions and middlewares.
crul8.8 0.0 route.cr VS crulCommand line HTTP client written in Crystal
cryload8.8 0.0 route.cr VS cryloadHTTP benchmarking tool written in Crystal
Cable8.7 0.0 route.cr VS CableIt's like ActionCable (100% compatible with JS Client), but you know, for Crystal
cossack8.6 0.0 route.cr VS cossackSimple and flexible HTTP client for Crystal with middleware and test support.
http28.6 0.0 route.cr VS http2HTTP/2 Protocol Implementation for the Crystal Language
http-protection8.0 0.0 route.cr VS http-protectionThis library protects against typical web attacks. It was inspired in rack-protection Ruby gem.
helmet6.5 0.0 route.cr VS helmeta port of the Node Helmet module to the Crystal programming language
crystal-routing6.2 0.0 route.cr VS crystal-routingExtensible library to deal with http request and string based routing in Crystal
beryl6.0 0.0 route.cr VS berylAction-focused HTTP routing library
session5.7 0.0 route.cr VS sessionCookie based sessions in Crystal HTTP applications
http-multiserver.cr5.4 0.0 route.cr VS http-multiserver.crMount multiple web applications 🚦
resp-crystal5.1 0.7 route.cr VS resp-crystalLightweight RESP client
http-params-serializableThe HTTP params parsing module for Crystal 🤓
sse.cr4.8 1.0 route.cr VS sse.crA Crystal shard for Server-Sent Events
http_parser.cr4.0 0.0 route.cr VS http_parser.crCrystal wrapper for Http Parser lib: https://github.com/joyent/http-parser
multipart.cr3.7 0.0 route.cr VS multipart.crAdds multipart and multipart/form-data support to the crystal standard library
proxy-fetcher.cr3.5 0.0 route.cr VS proxy-fetcher.crCrystal port of awesome Ruby ProxyFetcher gem
ContentDisposition3.1 0.0 route.cr VS ContentDispositionCrystal shard to create HTTP Content-Disposition headers with proper escaping/encoding of filenames
digest-auth2.7 0.0 route.cr VS digest-authHTTP digest auth for crystal lang
ntlm2.2 0.0 route.cr VS ntlmNTLM authentication for crystal lang
link-header1.8 0.0 route.cr VS link-headerCrystal Lang HTTP Link Header Parser
router-simple.cr1.5 0.0 route.cr VS router-simple.crsimple path router inspired by Router::Simple.
keyer_cr1.5 0.0 route.cr VS keyer_crHTTP Request Parameter Parsing
http_distributor1.5 0.0 route.cr VS http_distributorhttp server which allows sneaky http request though it.
crystal-cossack0.8 0.0 route.cr VS crystal-cossackSimple and flexible HTTP client for Crystal with middleware and test support.
HTTP::WebSocketHTTP WebSocket client (Crystal stdlib)
HTTP::ServerHTTP server (Crystal stdlib)
HTTP::ClientHTTP client (Crystal stdlib)
Static code analysis for 29 languages.
Do you think we are missing an alternative of route.cr or a related project?
The default web server of the Crystal is quite good :smile: but it weak at routing :cry:.
Kemal or other web frameworks written in Crystal are awesome :smile:, but it's too fat for some purpose :cry:.
router.cr is a minimum but High Performance middleware for Crystal web server.
See the amazing performance of router.cr here.:rocket:
Add this to your application's
dependencies: router: github: tbrand/router.cr
Router to utilize router.cr.
class WebServer include Router end
Define a method to draw all routes for your web server.
class WebServer include Router def draw_routes # Drawing routes HERE! end end
In that method, call HTTP method name (downcase) like
post with PATH and BLOCK where
- PATH : String
- BLOCK : block of HTTP::Server::Context, Hash(String, String) -> HTTP::Server::Context ```crystal class WebServer include Router
def draw_routes get "/" do |context, params| context.response.print "Hello router.cr!" context end end end
Here we've defined a GET route at root path (/) that just print out "Hello router.cr" when we get access. To activate (run) the route, just define run methods for your server with route_handler ```crystal class WebServer include Router def draw_routes get "/" do |context, params| context.response.print "Hello router.cr!" context end end def run server = HTTP::Server.new(route_handler) server.bind_tcp 8080 server.listen end end
Here route_handler is getter defined in Router. So you can call
route_handler at anywhere in WebServer instance.
Finally, run your server.
web_server = WebServer.new web_server.draw_routes web_server.run
See sample and [tips](sample) for details.
params is a Hash(String, String) that is used when you define a path parameters such as
:id is a parameters). Here is an example.
class WebServer include Router def draw_routes get "/user/:id" do |context, params| context.response.print params["id"] # get :id in url from params context end end end
See sample and [tips](sample) for details.
- Fork it ( https://github.com/tbrand/router.cr/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
- tbrand Taichiro Suzuki - creator, maintainer