Anuj-Panthri commited on
Commit
5fdba97
·
1 Parent(s): e87f541

solved api endpoint cors error

Browse files
app/api/routes.py CHANGED
@@ -95,6 +95,15 @@ def is_auth(func):
95
 
96
 
97
  #################################################################change_db############################################################################
 
 
 
 
 
 
 
 
 
98
  @bp.route("/add_person/",methods=["POST"])
99
  @is_auth
100
  def add_person(username):
 
95
 
96
 
97
  #################################################################change_db############################################################################
98
+ #to resolve cors error
99
+ @bp.after_request
100
+ def after_request(response):
101
+ response.headers.add('Access-Control-Allow-Origin', '*')
102
+ response.headers.add('Access-Control-Allow-Headers', 'Content-Type')
103
+ return response
104
+
105
+
106
+
107
  @bp.route("/add_person/",methods=["POST"])
108
  @is_auth
109
  def add_person(username):
app/static/demo/index/dark.css CHANGED
@@ -13,7 +13,6 @@
13
  background-color: rgb(12, 12, 12);
14
  color:white;
15
  font-weight: bold;
16
- font-family: 'Poppins';
17
  /* pointer-events: none; */
18
  }
19
 
 
13
  background-color: rgb(12, 12, 12);
14
  color:white;
15
  font-weight: bold;
 
16
  /* pointer-events: none; */
17
  }
18
 
app/static/global.css CHANGED
@@ -1,3 +1,6 @@
1
  body{
2
  position: relative;
 
 
 
3
  }
 
1
  body{
2
  position: relative;
3
+ }
4
+ *{
5
+ font-family: 'Poppins';
6
  }
app/templates/base.html CHANGED
@@ -5,6 +5,7 @@
5
 
6
  <link type="image/*" rel="icon" href="{{ url_for('static',filename='demo/index/icon.jpg' ) }}">
7
  <link type="text/css" rel="stylesheet" href="{{ url_for('static',filename='global.css' ) }}">
 
8
 
9
  {% block css %}{% endblock %}
10
  </head>
 
5
 
6
  <link type="image/*" rel="icon" href="{{ url_for('static',filename='demo/index/icon.jpg' ) }}">
7
  <link type="text/css" rel="stylesheet" href="{{ url_for('static',filename='global.css' ) }}">
8
+ <link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
9
 
10
  {% block css %}{% endblock %}
11
  </head>