I've got a backbone site that I'm trying to get up and running. The API I want to feed into it lives on the same server, but on a different port (port 8080).
When I try and access the API, I get errors about 'Same Origin Policy' and such, but since they're on the same server, I'm not sure what I'm doing wrong.
How can I access the data from the API with my model?
define(function (require) {
"use strict";
var $ = require('jquery'),
Backbone = require('backbone'),
api = "http://localhost:8080/api/v1/",
Candidate = Backbone.Model.extend({
urlRoot: api + "profiles/",
idAttribute: 'password',
initialize: function () {
console.log('Candidate initialized');
},
validate: function (attributes) {
console.log('validate');
console.log(attributes);
},
}),
CandidateCollection = Backbone.Collection.extend({
model: Candidate,
url: api + "profiles/",
});
return {
Candidate: Candidate,
CandidateCollection: CandidateCollection
};
});