diff --git a/framework/core/ember/app/adapters/application.js b/framework/core/ember/app/adapters/application.js index ec39c711d..bc8290e58 100644 --- a/framework/core/ember/app/adapters/application.js +++ b/framework/core/ember/app/adapters/application.js @@ -1,8 +1,9 @@ import JsonApiAdapter from 'ember-json-api/json-api-adapter'; +import config from '../config/environment'; export default JsonApiAdapter.extend({ // Todo: make this loaded via an environment variable or something - host: '/api' + host: config.apiURL }); \ No newline at end of file diff --git a/framework/core/ember/config/environment.js b/framework/core/ember/config/environment.js index 3a276770c..097618245 100644 --- a/framework/core/ember/config/environment.js +++ b/framework/core/ember/config/environment.js @@ -5,6 +5,7 @@ module.exports = function(environment) { modulePrefix: 'flarum', environment: environment, baseURL: '/', + apiURL: '/api', locationType: 'hash', EmberENV: { FEATURES: { @@ -31,6 +32,7 @@ module.exports = function(environment) { // Testem prefers this... ENV.baseURL = '/'; ENV.locationType = 'none'; + ENV.apiURL = 'http://flarum.dev/api', // keep test console output quieter ENV.APP.LOG_ACTIVE_GENERATION = false; diff --git a/framework/core/src/Flarum/Api/Actions/Base.php b/framework/core/src/Flarum/Api/Actions/Base.php index dadf70120..a90b75602 100644 --- a/framework/core/src/Flarum/Api/Actions/Base.php +++ b/framework/core/src/Flarum/Api/Actions/Base.php @@ -142,8 +142,8 @@ abstract class Base extends Controller protected function respondWithArray($array, $statusCode = 200, $headers = []) { - // @todo remove this - $headers['Access-Control-Allow-Origin'] = 'http://0.0.0.0:4200'; + // @todo remove this? + $headers['Access-Control-Allow-Origin'] = '*'; return Response::json($array, $statusCode, $headers); } diff --git a/framework/core/src/views/index.blade.php b/framework/core/src/views/index.blade.php index 6befa5b63..d6463b335 100644 --- a/framework/core/src/views/index.blade.php +++ b/framework/core/src/views/index.blade.php @@ -9,8 +9,8 @@ - - + + {{ app('flarum.web.assetManager')->styles() }}