aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamil Staps2015-05-07 12:13:40 +0300
committerCamil Staps2015-05-07 12:13:40 +0300
commit64672ee5cb36be604da9269a0e86416560ebc4fd (patch)
tree28d4ef97f63ab336e3b8c3f7ad002611efc66389
parentJsonP (diff)
Allow origin for requests config option
-rw-r--r--src/CamilStaps/BotleaguesApi/BotleaguesApiServiceProvider.php2
-rw-r--r--src/config/config.php4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/CamilStaps/BotleaguesApi/BotleaguesApiServiceProvider.php b/src/CamilStaps/BotleaguesApi/BotleaguesApiServiceProvider.php
index 22ec44c..4d6c93c 100644
--- a/src/CamilStaps/BotleaguesApi/BotleaguesApiServiceProvider.php
+++ b/src/CamilStaps/BotleaguesApi/BotleaguesApiServiceProvider.php
@@ -28,6 +28,8 @@ class BotleaguesApiServiceProvider extends ServiceProvider {
include __DIR__ . '/../../filters.php';
include __DIR__ . '/../../routes.php';
+
+ header('Access-Control-Allow-Origin: ' . Config::get('config.allowed_origin'));
App::fatal(function($e) {
return Response::make(
diff --git a/src/config/config.php b/src/config/config.php
index a622cda..cba8c73 100644
--- a/src/config/config.php
+++ b/src/config/config.php
@@ -8,6 +8,8 @@ return [
'json' => 'Dingo\Api\Http\ResponseFormat\JsonpResponseFormat',
- ]
+ ],
+
+ 'allowed_origin' => 'http://local.botleagues.camilstaps.nl'
];