lib/grenache/http.rb in grenache-ruby-http-0.1.3 vs lib/grenache/http.rb in grenache-ruby-http-0.1.4
- old
+ new
@@ -10,11 +10,12 @@
end
def start_http_service(port, &block)
EM.defer {
app = -> (env) {
- resp = block.call(env)
- [200,nil, Message.req(resp).to_json]
+ req = Message.parse(env['rack.input'].read)
+ resp = block.call(req)
+ [200,nil, Message.response_to(req,resp).to_json]
}
server = Thin::Server.start('0.0.0.0', port, app, {signals: false})
}
end