yuripeyamashita
commited on
Commit
•
ee3e7dd
1
Parent(s):
94a125f
Update app.py
Browse files
app.py
CHANGED
@@ -4,22 +4,22 @@ import requests
|
|
4 |
|
5 |
app = Flask(__name__)
|
6 |
|
7 |
-
|
8 |
headers = {'Authorization': os.environ.get("auth")}
|
9 |
|
10 |
-
|
11 |
|
12 |
-
@app.route('/
|
13 |
-
def
|
14 |
-
if request.json.get('
|
15 |
return {}, 400
|
16 |
-
|
17 |
URL = request.json.get('URL')
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
|
24 |
@app.route('/client', methods=['POST'])
|
25 |
def client():
|
|
|
4 |
|
5 |
app = Flask(__name__)
|
6 |
|
7 |
+
secret = os.environ.get("secret")
|
8 |
headers = {'Authorization': os.environ.get("auth")}
|
9 |
|
10 |
+
res = {}
|
11 |
|
12 |
+
@app.route('/queue', methods=['POST'])
|
13 |
+
def queue():
|
14 |
+
if request.json.get('secret') != secret:
|
15 |
return {}, 400
|
16 |
+
uuid = request.json.get('uuid')
|
17 |
URL = request.json.get('URL')
|
18 |
+
body = request.json.get('body')
|
19 |
+
response = requests.post(URL, json=body)
|
20 |
+
res[uuid] = response
|
21 |
+
print(res[uuid])
|
22 |
+
return response, 200
|
23 |
|
24 |
@app.route('/client', methods=['POST'])
|
25 |
def client():
|