DmitrMakeev
commited on
Commit
·
8645bf0
1
Parent(s):
303051b
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,25 @@
|
|
1 |
import flask
|
2 |
-
from flask import request, jsonify, send_file
|
3 |
import os
|
4 |
import json
|
5 |
from dotenv import load_dotenv
|
|
|
6 |
load_dotenv()
|
|
|
7 |
app = flask.Flask(__name__)
|
8 |
app.config["DEBUG"] = True
|
|
|
9 |
@app.route('/', methods=['GET'])
|
10 |
def index():
|
11 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
@app.route("/avp", methods=["POST"])
|
13 |
def avp():
|
14 |
try:
|
@@ -35,5 +46,6 @@ def avp():
|
|
35 |
"error": str(e)
|
36 |
}
|
37 |
return jsonify(error_response), 500
|
|
|
38 |
if __name__ == '__main__':
|
39 |
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 7860)))
|
|
|
1 |
import flask
|
2 |
+
from flask import request, jsonify, send_file
|
3 |
import os
|
4 |
import json
|
5 |
from dotenv import load_dotenv
|
6 |
+
|
7 |
load_dotenv()
|
8 |
+
|
9 |
app = flask.Flask(__name__)
|
10 |
app.config["DEBUG"] = True
|
11 |
+
|
12 |
@app.route('/', methods=['GET'])
|
13 |
def index():
|
14 |
+
return '''
|
15 |
+
<html>
|
16 |
+
<body>
|
17 |
+
<h1>Привет, Мир!</h1>
|
18 |
+
<p>Это моя страница.</p>
|
19 |
+
</body>
|
20 |
+
</html>
|
21 |
+
'''
|
22 |
+
|
23 |
@app.route("/avp", methods=["POST"])
|
24 |
def avp():
|
25 |
try:
|
|
|
46 |
"error": str(e)
|
47 |
}
|
48 |
return jsonify(error_response), 500
|
49 |
+
|
50 |
if __name__ == '__main__':
|
51 |
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 7860)))
|