README.md in rack-app-0.5.0 vs README.md in rack-app-0.6.0
- old
+ new
@@ -35,46 +35,28 @@
config.ru
```ruby
require 'rack/app'
-require_relative 'lib/bootstrap'
-
class YourAwesomeApp < Rack::App
- mount AwesomeController
-
get '/hello' do
'Hello World!'
end
- get '/nope' do
- request.env
- response.write 'some response body'
- end
-
- post '/lol_post_fail' do
- status 500
- 'LOL'
- end
-
get '/users/:user_id' do
- params['user_id']
+ get_user_id
end
- post '/some/endpoint/for/the/rabbit/:queue_name' do
- mq_request # helper are the class instance method
+ def get_user_id
+ params['user_id']
end
- def mq_request
- q = BUNNY_CONN_CHANNEL.queue(params['queue_name'])
- BUNNY_CONN_CHANNEL.default_exchange.publish(request.body.read, :routing_key => q.name)
- end
-
end
run YourAwesomeApp
+
```
you can access Rack::Request with the request method and
Rack::Response as response method.
@@ -84,11 +66,11 @@
use bundled in testing module for writing unit test for your rack application
```ruby
-require_relative '../../spec_helper'
+require 'spec_helper'
require 'rack/app/test'
describe MyRackApp do
include Rack::App::Test
@@ -117,40 +99,36 @@
* [Escher Authorized Api](https://github.com/adamluzsi/rack-app.rb-examples/tree/master/escher_authorized)
* complex authorization for corporal level api use
## [Benchmarking](https://github.com/adamluzsi/rack-app.rb-benchmark)
-* Dump duration with zero if or routing: 6.0e-06 s
+* Dumb duration with zero if or routing: 5.0e-06 s - 6.0e-06 s
* no routing
* return only a static array with static values
-* Rack::App duration with routing lookup: 7.0e-05 s
+* Rack::App duration with routing lookup: 6.3e-05 s - 7.0e-05 s
* with routing
* with value parsing and reponse object building
-* Grape::API duration with routing lookup: 0.180764 s
+* Grape::API duration with routing lookup: 0.028236 s - 0.180764 s
* with routing
* with value parsing and reponse object building
This was measured with multiple endpoints like that would be in real life example.
i feared do this for Rails that is usually slower than Grape :S
-## TODO
-
-* benchmark for Rails::API, Grape::API and etc to prove awesomeness in term of speed
-* more verbose readme
-* drink less coffee
-
## Roadmap
-### 0.6.0
+### 0.7.0
* serializer block/method for class shared serialization logic
+* Mount method should able to take namespace option
+* Create erb Parser Gem for View/FileServer to support to .erb files
-### 0.7.0
+### 0.8.0
* content_type syntax sugar on class level
* response_headers syntax sugar for request processing
-### 0.8.0
+### 0.9.0
* custom error_handler block for api, where Exception class types can be defined to process
* NULL Object pattern for error_handler_fetcher
## Development