저는 사용자가 도박 풀에 베팅을 할 수있는 앱을 개발 중입니다. 사용자가 버튼을 클릭하면 컨트롤러의 기능이 실행되지만 요청이 수행되지 않고 404 오류가 반환됩니다. 조언이 있으면 크게 환영 할 것입니다.
function placeBet(bet) {
console.log('in place bet');
$http.post('https://colossusdevtest.herokuapp.com/api/tickets.json', {
'id': 550900,
'status': 'PLACED',
'customer_payout': '0.0',
'stake': bet,
'currency': 'GBP',
'lines': 24,
'amount_owned_customer': '1.0',
'cost': '12.0',
'created_at': '2015-07-23T17:00:10.000Z',
'offer_amount': '0.0',
'customer_winnings': '0.0',
'offers_accepted': '0.0',
'merchant_ref': '15ac9a2e-d4a8-4652-a60c-2b57d1afd92b',
'pool': {
'id': 171,
'name': 'Mixed 4',
'type_code': 'POINT_MARGIN',
'headline_prize': '4996.06',
'status': 'OPEN',
'sched_start': '2015-07-28T11:00:00.000Z',
'sched_next': '2015-07-28T11:00:00.000Z',
'currency': 'GBP',
'leg_num': 4,
'sport_code': 'RUGBY',
'has_offers': false
}
}).then(() => {
console.log('information posted');
});
}
$scope.placeBet = placeBet;
POST가 가능합니까? 잘 작동합니다. – Mazz
CORS 요청을 하시겠습니까? 그렇다면 CORS 요청을 허용하도록 heroku 앱이 설정되어 있습니까? – alexm