examples/echo.rb in goliath-0.9.0 vs examples/echo.rb in goliath-0.9.1
- old
+ new
@@ -7,21 +7,17 @@
# Goliath uses multi-jon, so pick your favorite JSON serializer
# require 'json'
require 'yajl'
class Echo < Goliath::API
-
- # reload code on every request in dev environment
- use ::Rack::Reloader, 0 if Goliath.dev?
-
use Goliath::Rack::Params # parse & merge query and body parameters
use Goliath::Rack::DefaultMimeType # cleanup accepted media types
use Goliath::Rack::Formatters::JSON # JSON output formatter
use Goliath::Rack::Render # auto-negotiate response format
use Goliath::Rack::Heartbeat # respond to /status with 200, OK (monitoring, etc)
use Goliath::Rack::ValidationError # catch and render validation errors
- use Goliath::Rack::Validation::RequestMethod, %w(GET) # allow GET requests only
+ use Goliath::Rack::Validation::RequestMethod, %w(GET POST) # allow GET and POST requests only
use Goliath::Rack::Validation::RequiredParam, {:key => 'echo'} # must provide ?echo= query or body param
plugin Goliath::Plugin::Latency # output reactor latency every second
def process_request
\ No newline at end of file