Sha256: 8e7b1ec20f54b62a8fbcb12664a5a624eda2b8a509b9553803e06147e492baaf
Contents?: true
Size: 1.21 KB
Versions: 1
Compression:
Stored size: 1.21 KB
Contents
module QPush module Web class Server < Sinatra::Base #set :public_folder, File.expand_path(File.dirname(__FILE__)) + '/public' before do #pass if request.path_info == '/' content_type :json headers 'Access-Control-Allow-Origin' => '*', 'Access-Control-Allow-Methods' => ['OPTIONS', 'GET', 'POST'] end #get '/' do #File.read(File.join(settings.public_folder, 'index.html')) #end get '/stats' do Get.stats end get '/heartbeat' do Get.heartbeat end get '/history' do Get.history end get '/jobs' do Get.jobs end post '/queue_delayed' do Post.queue_delayed(params[:id], params[:score]) end get '/delays' do Get.delays(params[:start].to_i, params[:count].to_i).to_json end get '/crons' do Get.crons(params[:start].to_i, params[:count].to_i) end get '/retries' do Get.retries(params[:start], params[:count]) end get '/morgue' do Get.morgue(params[:start].to_i, params[:count].to_i) end post '/create' do Post.create(params) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
qpush-0.1.6 | lib/qpush/web/server.rb |