lib/opener/chained_daemon/webservice.rb in opener-chained-daemon-3.0.1 vs lib/opener/chained_daemon/webservice.rb in opener-chained-daemon-3.0.5
- old
+ new
@@ -10,20 +10,19 @@
self.processor = ChainedDaemon.new
route do |r|
response.status = 403 and r.halt if r.params['auth_token'] != TOKEN
- r.get 'sentiment.kaf' do
- params = r.params.except 'input'
- params.deep_symbolize_keys!
- kaf = processor.run r.params['input'], **params
+ sentiment = -> do
+ r.params.deep_symbolize_keys!
+ kaf = processor.run r.params[:input], **r.params.except(:input)
response['Content-Type'] = 'text/xml'
kaf
end
- end
- def clear_cache
+ r.get 'sentiment.kaf', &sentiment
+ r.post 'sentiment.kaf', &sentiment
end
end
end
end