Danisz commited on
Commit
c992804
·
1 Parent(s): 26440d6

Assets from file_parent

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -2,6 +2,7 @@ from contextlib import asynccontextmanager
2
  import flet.fastapi as flet_fastapi
3
  import logging
4
  from fastapi import FastAPI
 
5
 
6
  from flet_app import main
7
  from js_execution import mount_flet_app
@@ -22,7 +23,10 @@ app = FastAPI(lifespan=lifespan)
22
  # Extend the Flet Page class
23
  extend_flet_page()
24
 
25
- # Use the new mount_flet_app function with the same arguments
26
- flet_app = flet_fastapi.app(main, assets_dir="./assets")
 
 
 
27
 
28
  mount_flet_app(app, "/", flet_app)
 
2
  import flet.fastapi as flet_fastapi
3
  import logging
4
  from fastapi import FastAPI
5
+ from pathlib import Path
6
 
7
  from flet_app import main
8
  from js_execution import mount_flet_app
 
23
  # Extend the Flet Page class
24
  extend_flet_page()
25
 
26
+ current_dir = Path(__file__).parent.resolve()
27
+ assets_path = current_dir / "assets"
28
+
29
+ # Use the constructed assets path in the flet_fastapi.app call
30
+ flet_app = flet_fastapi.app(main, assets_dir=str(assets_path))
31
 
32
  mount_flet_app(app, "/", flet_app)