|
@@ -2,7 +2,7 @@ from array import array
|
|
import threading
|
|
import threading
|
|
from flask import session,Flask,request, jsonify
|
|
from flask import session,Flask,request, jsonify
|
|
import flask
|
|
import flask
|
|
-
|
|
|
|
|
|
+import flask_cors
|
|
|
|
|
|
import persistence
|
|
import persistence
|
|
import Model.isp_model as isp_model
|
|
import Model.isp_model as isp_model
|
|
@@ -27,7 +27,7 @@ __app__.secret_key = "aseqzdwxc"
|
|
__app__.permanent_session_lifetime = timedelta(minutes=2)
|
|
__app__.permanent_session_lifetime = timedelta(minutes=2)
|
|
__app__.logger = logger
|
|
__app__.logger = logger
|
|
__app__.config['JSONIFY_PRETTYPRINT_REGULAR'] = True
|
|
__app__.config['JSONIFY_PRETTYPRINT_REGULAR'] = True
|
|
-
|
|
|
|
|
|
+flask_cors.CORS(__app__)
|
|
|
|
|
|
|
|
|
|
limiter = Limiter(__app__,key_func=get_remote_address,default_limits=["100 per minute"])
|
|
limiter = Limiter(__app__,key_func=get_remote_address,default_limits=["100 per minute"])
|
|
@@ -68,9 +68,9 @@ def after_request(response : flask.Response):
|
|
# adding this to the header to allow cross origin
|
|
# adding this to the header to allow cross origin
|
|
# for exemple origin cross origin is when website with javascript has it's server (origin 1)
|
|
# for exemple origin cross origin is when website with javascript has it's server (origin 1)
|
|
# and the javascript call some request on another server (origin 2), typically our API.
|
|
# and the javascript call some request on another server (origin 2), typically our API.
|
|
- header['Access-Control-Allow-Origin'] = '*'
|
|
|
|
- header['Access-Control-Allow-Methods'] = 'GET,DELETE,UPDATE,HEAD,OPTIONS,POST,PUT'
|
|
|
|
- header['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'
|
|
|
|
|
|
+ #header['Access-Control-Allow-Origin'] = '*'
|
|
|
|
+ #header['Access-Control-Allow-Methods'] = 'GET,DELETE,UPDATE,HEAD,OPTIONS,POST,PUT'
|
|
|
|
+ #header['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'
|
|
|
|
|
|
logger.debug(response.__dict__)
|
|
logger.debug(response.__dict__)
|
|
|
|
|