lib/soulmate/server.rb in soulmate-0.0.4 vs lib/soulmate/server.rb in soulmate-0.0.5
- old
+ new
@@ -12,11 +12,11 @@
before do
content_type 'application/json', :charset => 'utf-8'
end
get '/' do
- JSON.pretty_generate({ :soulmate => Soulmate::Version::STRING, :status => "ok" })
+ MultiJson.encode({ :soulmate => Soulmate::Version::STRING, :status => "ok" })
end
get '/search' do
raise Sinatra::NotFound unless (params[:term] and params[:types] and params[:types].is_a?(Array))
@@ -28,18 +28,18 @@
types.each do |type|
matcher = Matcher.new(type)
results[type] = matcher.matches_for_term(term, :limit => limit)
end
- JSON.pretty_generate({
+ MultiJson.encode({
:term => params[:term],
:results => results
})
end
not_found do
content_type 'application/json', :charset => 'utf-8'
- JSON.pretty_generate({ :error => "not found" })
+ MultiJson.encode({ :error => "not found" })
end
end
end