Jensen-holm commited on
Commit
8ea5c07
·
1 Parent(s): 2fc4a94

adding CORS support

Browse files
Files changed (2) hide show
  1. app.py +3 -0
  2. requirements.txt +1 -0
app.py CHANGED
@@ -1,4 +1,5 @@
1
  from flask import Flask, request, jsonify, Response
 
2
  from nn.nn import NN
3
  from nn import train as train_nn
4
  from nn import activation
@@ -7,6 +8,8 @@ import io
7
 
8
  app = Flask(__name__)
9
 
 
 
10
 
11
  @app.route("/neural-network", methods=["POST"])
12
  def neural_net():
 
1
  from flask import Flask, request, jsonify, Response
2
+ from flask_cors import CORS
3
  from nn.nn import NN
4
  from nn import train as train_nn
5
  from nn import activation
 
8
 
9
  app = Flask(__name__)
10
 
11
+ CORS(app, origins="*")
12
+
13
 
14
  @app.route("/neural-network", methods=["POST"])
15
  def neural_net():
requirements.txt CHANGED
@@ -5,3 +5,4 @@ requests==2.28.2
5
  scikit_learn==1.3.1
6
  gunicorn==21.2.0
7
  Werkzeug==2.2.2
 
 
5
  scikit_learn==1.3.1
6
  gunicorn==21.2.0
7
  Werkzeug==2.2.2
8
+ Flask_Cors==3.0.10