kemal/README.md

77 lines
1.9 KiB
Markdown
Raw Normal View History

2017-03-04 16:24:05 +00:00
[![Kemal](media/header.png)](http://kemalcr.com)
2015-06-01 21:06:26 +00:00
2017-03-04 16:24:05 +00:00
> Lightning Fast, Super Simple web framework.
2017-03-04 16:08:26 +00:00
2017-03-04 16:24:05 +00:00
[![Build Status](https://travis-ci.org/kemalcr/kemal.svg?branch=master)](https://travis-ci.org/kemalcr/kemal)
[![Join the chat at https://gitter.im/sdogruyol/kemal](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sdogruyol/kemal?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2015-10-23 18:44:41 +00:00
# Super Simple ⚡️
2015-10-23 19:43:33 +00:00
```ruby
2015-10-24 13:48:47 +00:00
require "kemal"
# Matches GET "http://host:port/"
2015-10-23 19:43:33 +00:00
get "/" do
"Hello World!"
end
# Creates a WebSocket handler.
# Matches "ws://host:port/socket"
ws "/socket" do |socket|
socket.send "Hello from Kemal!"
end
2016-03-19 13:37:33 +00:00
Kemal.run
2015-10-23 19:43:33 +00:00
```
2016-03-19 13:37:33 +00:00
Start your application!
2015-10-24 16:20:49 +00:00
```
2016-03-19 13:37:33 +00:00
crystal src/kemal_sample.cr
2015-10-24 16:20:49 +00:00
```
2015-10-23 19:43:33 +00:00
Go to *http://localhost:3000*
2016-11-25 15:15:18 +00:00
Check [documentation](http://kemalcr.com) or [samples](https://github.com/kemalcr/kemal/tree/master/samples) for more.
2015-10-24 13:50:26 +00:00
# Super Fast 🚀
2015-11-09 18:57:54 +00:00
Numbers speak louder than words.
| Framework | Request Per Second | Avg. Response Time |
2016-01-25 08:50:54 +00:00
| --------------------- | :-----------------: | -----------------: |
| Kemal (Production) | 100238 | 395.44μs |
| Sinatra (Thin) | 2274 | 43.82ms |
2015-11-09 18:57:54 +00:00
2015-11-17 19:53:33 +00:00
These results were achieved with ```wrk``` on a Macbook Pro Late 2013. (**2Ghz i7 8GB Ram OS X Yosemite**)
# Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
2016-12-10 09:29:08 +00:00
kemal:
github: kemalcr/kemal
branch: master
```
2015-12-16 18:32:01 +00:00
# Features
2015-10-23 18:50:19 +00:00
2015-12-16 18:32:01 +00:00
- Support all REST verbs
- Websocket support
- Request/Response context, easy parameter handling
- Middlewares
- Built-in JSON support
- Built-in static file serving
2016-02-20 21:50:13 +00:00
- Built-in view templating via [Kilt](https://github.com/jeromegn/kilt)
2015-12-16 18:34:30 +00:00
# Documentation
2016-02-06 13:30:10 +00:00
You can read the documentation at the official site [kemalcr.com](http://kemalcr.com)
2015-12-16 18:34:30 +00:00
2015-10-23 19:51:39 +00:00
## Thanks
Thanks to Manas for their awesome work on [Frank](https://github.com/manastech/frank).