When using this starter code, do NOT create an API constant. This will cause issues when deploying to Heroku.
Instead, simply prefix your AJAX requests with /api
.
For example
$http.get('/api/birds')
.then(res => console.log(res));
Or with ngResource
:
$resource('/api/birds/:id', { id: '@id' }, {
update: { method: 'PUT' }
});
Andy Savva Ben