Improvements based on import test.
[rock.divinelegy.git] / public_html / index.php
index d4843d3..2aa5c39 100644 (file)
@@ -1,12 +1,15 @@
 <?php\r
 \r
-//TODO: Config this\r
-header("Access-Control-Allow-Origin: http://172.17.12.110:8000");\r
-header("Access-Control-Allow-Origin: http://roll.divinelegy.meeples:8000");\r
-//header("Access-Control-Allow-Origin: http://roll.divinelegy.dev:8000");\r
-\r
 require_once('../vendor/autoload.php');\r
 \r
+$config = require('../config/app.php');\r
+\r
+// Allow these origins to do cross domain JS.\r
+header("Access-Control-Allow-Origin: " . $config['allow-origin']);\r
+\r
+// Nice exceptions\r
+if($config['mode'] == 'production') set_exception_handler(array('\Services\StatusReporter', 'exception'));\r
+\r
 // Everything time related should be UTC+0 based\r
 date_default_timezone_set('UTC');\r
 \r