Class: Utter::Internals::Service

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/utter/service.rb

Direct Known Subclasses

Service

Instance Method Summary collapse

Instance Method Details

#route(verb, path, options = {}, &block) ⇒ Object

TODO set a flag to disable this in production for security this helps testing APIs on localmachines as CORS fucks developers time. But not recommended to be set while in production enviroments before do response.headers = “*” response.headers = “*” #response.headers = “POST” p response.headers.inspect

end

Makes sure that any response Utter gives back is in JSON format TODO check if streaming needs a different class if this mechanism doesn’t work with it



32
33
34
35
36
# File 'lib/utter/service.rb', line 32

def route(verb, path, options = {}, &block)
  super
  signature.to_json # regular json
  #json signature #NOTE we can use regular json or sinatra/json'
end