From 05eb97a3cbbc1b3b43f915796108cd5cf7b4d005 Mon Sep 17 00:00:00 2001
From: erichard <elliot.richard@lal.in2p3.fr>
Date: Thu, 25 Jun 2020 16:10:06 +0200
Subject: [PATCH] Allow Cross Origin Request Secure (CORS)

---
 app/__init__.py         | 2 ++
 docker/requirements.txt | 1 +
 2 files changed, 3 insertions(+)

diff --git a/app/__init__.py b/app/__init__.py
index c7436a6..0f4d397 100644
--- a/app/__init__.py
+++ b/app/__init__.py
@@ -1,6 +1,7 @@
 import os
 from flask import Flask, render_template
 from flask_sqlalchemy import SQLAlchemy
+from flask_cors import CORS
 
 
 db = SQLAlchemy()
@@ -19,6 +20,7 @@ def create_app():
                       "Label": "Label(s)"
                       }
     app = CustomFlask(__name__)
+    CORS(app)
     db.init_app(app)
 
     app.config.from_object(os.environ['LABELSTOWER_ENV'])
diff --git a/docker/requirements.txt b/docker/requirements.txt
index 7ea5c82..362db1f 100644
--- a/docker/requirements.txt
+++ b/docker/requirements.txt
@@ -15,3 +15,4 @@ six==1.12.0
 SQLAlchemy==1.3.13
 Werkzeug==0.16.0
 WTForms==2.2.1
+Flask-Cors==3.0.8
-- 
GitLab