haepada commited on
Commit
131e4f2
·
verified ·
1 Parent(s): d6db697

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -25
app.py CHANGED
@@ -30,30 +30,6 @@ ONCHEON_STORY = """
30
  산책로를 따라 걸으며 본 프로젝트 체험 시 보다 몰입된 경험이 가능합니다.
31
  """
32
 
33
- # Flask 앱 초기화
34
- load_dotenv()
35
- app = Flask(__name__)
36
- gradio_app = create_interface().queue()
37
- app = gr.mount_gradio_app(app, gradio_app, path="/gradio")
38
-
39
- # Flask 라우트
40
- @app.route('/static/<path:path>')
41
- def serve_static(path):
42
- return send_from_directory('static', path)
43
-
44
- @app.route('/')
45
- def index():
46
- return render_template('index.html')
47
-
48
- @app.route('/static/<path:path>')
49
- @app.route('/assets/<path:path>')
50
- @app.route('/manifest.json')
51
- @app.route('/service-worker.js')
52
-
53
- @app.route('/wishes/<path:path>')
54
- def serve_wishes(path):
55
- return send_from_directory('data/wishes', path)
56
-
57
 
58
  class SimpleDB:
59
  def __init__(self, reflections_path="data/reflections.json", wishes_path="data/wishes.json"):
@@ -1819,6 +1795,32 @@ def create_interface():
1819
 
1820
  return app
1821
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1822
  if __name__ == "__main__":
1823
  audio_path = os.path.join('assets', 'main_music.mp3')
1824
  if os.path.exists(audio_path):
@@ -1910,4 +1912,10 @@ if __name__ == "__main__":
1910
  show_error=True,
1911
  height=None,
1912
  width="100%"
1913
- )
 
 
 
 
 
 
 
30
  산책로를 따라 걸으며 본 프로젝트 체험 시 보다 몰입된 경험이 가능합니다.
31
  """
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  class SimpleDB:
35
  def __init__(self, reflections_path="data/reflections.json", wishes_path="data/wishes.json"):
 
1795
 
1796
  return app
1797
 
1798
+
1799
+ # Flask 앱 초기화
1800
+ load_dotenv()
1801
+ app = Flask(__name__)
1802
+ gradio_app = create_interface().queue()
1803
+ app = gr.mount_gradio_app(app, gradio_app, path="/gradio")
1804
+
1805
+ # Flask 라우트
1806
+ @app.route('/static/<path:path>')
1807
+ def serve_static(path):
1808
+ return send_from_directory('static', path)
1809
+
1810
+ @app.route('/')
1811
+ def index():
1812
+ return render_template('index.html')
1813
+
1814
+ @app.route('/static/<path:path>')
1815
+ @app.route('/assets/<path:path>')
1816
+ @app.route('/manifest.json')
1817
+ @app.route('/service-worker.js')
1818
+
1819
+ @app.route('/wishes/<path:path>')
1820
+ def serve_wishes(path):
1821
+ return send_from_directory('data/wishes', path)
1822
+
1823
+
1824
  if __name__ == "__main__":
1825
  audio_path = os.path.join('assets', 'main_music.mp3')
1826
  if os.path.exists(audio_path):
 
1912
  show_error=True,
1913
  height=None,
1914
  width="100%"
1915
+ )
1916
+
1917
+ app.run(
1918
+ host="0.0.0.0",
1919
+ port=8000,
1920
+ debug=True
1921
+ )