Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
-
from flask import Flask, render_template_string
|
|
|
|
| 2 |
|
| 3 |
app = Flask(__name__)
|
| 4 |
|
|
@@ -879,7 +880,7 @@ HTML_TEMPLATE = '''
|
|
| 879 |
|
| 880 |
// 이미지 생성
|
| 881 |
const img = document.createElement('img');
|
| 882 |
-
img.src = 'webtoon.png';
|
| 883 |
img.className = 'webtoon-image';
|
| 884 |
img.alt = 'webtoon.png';
|
| 885 |
img.id = 'webtoon-image-1';
|
|
@@ -1417,12 +1418,12 @@ HTML_TEMPLATE = '''
|
|
| 1417 |
</html>
|
| 1418 |
'''
|
| 1419 |
|
| 1420 |
-
@app.route('/')
|
| 1421 |
-
def
|
| 1422 |
-
|
| 1423 |
-
|
| 1424 |
-
if
|
| 1425 |
-
|
| 1426 |
-
|
| 1427 |
-
|
| 1428 |
-
|
|
|
|
| 1 |
+
from flask import Flask, render_template_string, send_file
|
| 2 |
+
import os
|
| 3 |
|
| 4 |
app = Flask(__name__)
|
| 5 |
|
|
|
|
| 880 |
|
| 881 |
// 이미지 생성
|
| 882 |
const img = document.createElement('img');
|
| 883 |
+
img.src = '/webtoon.png';
|
| 884 |
img.className = 'webtoon-image';
|
| 885 |
img.alt = 'webtoon.png';
|
| 886 |
img.id = 'webtoon-image-1';
|
|
|
|
| 1418 |
</html>
|
| 1419 |
'''
|
| 1420 |
|
| 1421 |
+
@app.route('/webtoon.png')
|
| 1422 |
+
def serve_webtoon_image():
|
| 1423 |
+
# webtoon.png 파일 경로 설정
|
| 1424 |
+
image_path = os.path.join(os.path.dirname(__file__), 'webtoon.png')
|
| 1425 |
+
if os.path.exists(image_path):
|
| 1426 |
+
return send_file(image_path, mimetype='image/png')
|
| 1427 |
+
else:
|
| 1428 |
+
# 파일이 없을 경우 404 에러
|
| 1429 |
+
return "Image not found", 404
|