javascript - Backbone.js site across different ports -


i've got backbone site i'm trying , running. api want feed lives on same server, on different port (port 8080).

when try , access api, errors 'same origin policy' , such, since they're on same server, i'm not sure i'm doing wrong.

how can access data api 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     }; }); 

can add apache , proxypass rule /api routed http://localhost:8080/api

proxypass /api http://localhost:8080/api proxypassreverse /api http://localhost:8080/api 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -