Spaces:
Sleeping
Sleeping
DmitrMakeev
commited on
Commit
•
b9757a6
1
Parent(s):
12c46c8
Update app.py
Browse files
app.py
CHANGED
@@ -100,6 +100,10 @@ def se_mes_im():
|
|
100 |
|
101 |
|
102 |
|
|
|
|
|
|
|
|
|
103 |
|
104 |
@app.route('/upload', methods=['POST'])
|
105 |
def upload_file():
|
@@ -114,21 +118,11 @@ def upload_file():
|
|
114 |
save_path = os.path.join(UPLOAD_FOLDER, unique_filename)
|
115 |
file.save(save_path)
|
116 |
|
117 |
-
|
118 |
-
return f"File uploaded successfully. New filename: {unique_filename}", 200
|
119 |
-
|
120 |
-
@app.route('/image', methods=['GET'])
|
121 |
-
def get_image():
|
122 |
-
return send_from_directory(UPLOAD_FOLDER, IMAGE_FILENAME)
|
123 |
-
|
124 |
-
|
125 |
|
126 |
-
@app.route('/
|
127 |
-
def
|
128 |
-
|
129 |
-
if own_url is None:
|
130 |
-
return "OWN_URL not provided in the request", 400
|
131 |
-
return own_url, 200
|
132 |
|
133 |
@app.route('/se_mes_im2', methods=['GET'])
|
134 |
def se_mes_im2():
|
|
|
100 |
|
101 |
|
102 |
|
103 |
+
|
104 |
+
@app.route('/online', methods=['GET'])
|
105 |
+
def online():
|
106 |
+
return render_template('online.html')
|
107 |
|
108 |
@app.route('/upload', methods=['POST'])
|
109 |
def upload_file():
|
|
|
118 |
save_path = os.path.join(UPLOAD_FOLDER, unique_filename)
|
119 |
file.save(save_path)
|
120 |
|
121 |
+
return f"File uploaded successfully and saved to {save_path}", 200
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
|
123 |
+
@app.route('/image/<filename>', methods=['GET'])
|
124 |
+
def get_image(filename):
|
125 |
+
return send_from_directory(UPLOAD_FOLDER, filename)
|
|
|
|
|
|
|
126 |
|
127 |
@app.route('/se_mes_im2', methods=['GET'])
|
128 |
def se_mes_im2():
|