Setting up CORS

This commit is contained in:
Matthew Dillon 2015-01-27 16:33:20 -09:00
parent b1275edfd0
commit 0cd461db18
4 changed files with 9 additions and 4 deletions

View file

@ -1,5 +1,7 @@
import DS from 'ember-data'; import DS from 'ember-data';
import config from '../config/environment';
export default DS.RESTAdapter.reopen({ export default DS.RESTAdapter.reopen({
namespace: 'api' namespace: 'api',
host: config.apiURL
}); });

View file

@ -1,8 +1,9 @@
import Ember from 'ember'; import Ember from 'ember';
import Base from 'simple-auth/authenticators/base'; import Base from 'simple-auth/authenticators/base';
import config from '../config/environment';
export default Base.extend({ export default Base.extend({
tokenEndpoint: '/api/authenticate', tokenEndpoint: config.apiURL + '/api/authenticate',
restore: function(data) { restore: function(data) {
return new Ember.RSVP.Promise(function(resolve, reject) { return new Ember.RSVP.Promise(function(resolve, reject) {

View file

@ -26,8 +26,10 @@ module.exports = function(environment) {
ENV.APP.LOG_TRANSITIONS_INTERNAL = true; ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
// ENV.APP.LOG_VIEW_LOOKUPS = true; // ENV.APP.LOG_VIEW_LOOKUPS = true;
ENV['simple-auth'] = { ENV['simple-auth'] = {
authorizer: 'authorizers:custom' authorizer: 'authorizers:custom',
crossOriginWhitelist: ['http://127.0.0.1:8901']
} }
ENV.apiURL = 'http://127.0.0.1:8901';
} }
if (environment === 'test') { if (environment === 'test') {

View file

@ -21,7 +21,7 @@
"devDependencies": { "devDependencies": {
"broccoli-asset-rev": "^2.0.0", "broccoli-asset-rev": "^2.0.0",
"broccoli-ember-hbs-template-compiler": "^1.6.1", "broccoli-ember-hbs-template-compiler": "^1.6.1",
"ember-cli": "0.1.9", "ember-cli": "^0.1.9",
"ember-cli-6to5": "0.2.1", "ember-cli-6to5": "0.2.1",
"ember-cli-content-security-policy": "0.3.0", "ember-cli-content-security-policy": "0.3.0",
"ember-cli-dependency-checker": "0.0.7", "ember-cli-dependency-checker": "0.0.7",