diff options
-rw-r--r-- | src/App.php | 1 | ||||
-rw-r--r-- | templates/config/config.toml | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/App.php b/src/App.php index b270b02..107113a 100644 --- a/src/App.php +++ b/src/App.php @@ -106,6 +106,7 @@ class App } $response->headers->set('Content-Type', 'application/json'); + $response->headers->set('Access-Control-Allow-Origin', implode(',', $config['api']['cors']['origins'])); $response->setContent(json_encode($content)); $response->send(); } diff --git a/templates/config/config.toml b/templates/config/config.toml index 1011e90..8f9a76f 100644 --- a/templates/config/config.toml +++ b/templates/config/config.toml @@ -9,3 +9,6 @@ password = 123456 [api] keys = [] +[api.cors] +origins = [] + |