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
开始