static
This commit is contained in:
		| @@ -1,5 +1,5 @@ | ||||
| import sentry_sdk | ||||
| from pathlib import Path | ||||
| import os | ||||
| from fastapi import FastAPI | ||||
| from fastapi.routing import APIRoute | ||||
| from starlette.middleware.cors import CORSMiddleware | ||||
| @@ -21,17 +21,7 @@ app = FastAPI( | ||||
|     generate_unique_id_function=custom_generate_unique_id, | ||||
|      | ||||
| ) | ||||
| # app.mount("/static", StaticFiles(directory="static"), name="static") | ||||
|  | ||||
|  | ||||
| current_file = Path(__file__) | ||||
| current_file_dir = current_file.parent | ||||
| project_root = current_file_dir.parent | ||||
| project_root_absolute = project_root.resolve() | ||||
| static_root_absolute = project_root_absolute / "static"  | ||||
|  | ||||
| app.mount("/static", static_root_absolute, name="static") | ||||
|  | ||||
| app.mount("/static", StaticFiles(directory="static"), name="static") | ||||
| # Set all CORS enabled origins | ||||
| if settings.BACKEND_CORS_ORIGINS: | ||||
|     app.add_middleware( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user