0
我試圖部署在Heroku https://www.heroku.com/home我西納特拉 我成功之前,我試過後方法,它給了我 Get方法做工精細:西納特拉的Heroku後
這裏的例子代碼:
get '/getPriceList' do //no error, everything works fine
content_type :json, charset: 'utf-8'
today_menu.to_json
end
post '/makeOrder', provides: :json do //error NOT FOUND
data = request.env['rack.input'].read
parsed_data = JSON.parse data.force_encoding('UTF-8')
if User.where(:name => parsed_data['userName']).first.nil?
current = Time.now
fixed = Time.local(current.year, current.month, current.day, 18, 40, 0)
if current > fixed
ObedResponse.new(data, false, 'Vi ne uspeli').to_json
else
@user = User.create(:name => parsed_data['userName'])
#some stuff
end
ObedResponse.new(data, true, "").to_json
end
else
ObedResponse.new(data, false, 'Сегодня вы уже заказали').to_json
end
有人能告訴我爲什麼我得到這個錯誤,以及如何使這件事情的工作?
PS:在部署本地使用
bundle exec ruby obed.rb -e production
開始