Switch to angular
This commit is contained in:
31
app/main.py
31
app/main.py
@@ -1,9 +1,8 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.responses import FileResponse
|
||||
from app.api.artifacts import router as artifacts_router
|
||||
from app.api.seed import router as seed_router
|
||||
from app.api.tags import router as tags_router
|
||||
from app.database import init_db
|
||||
from app.config import settings
|
||||
import logging
|
||||
@@ -38,11 +37,9 @@ app.add_middleware(
|
||||
# Include routers
|
||||
app.include_router(artifacts_router)
|
||||
app.include_router(seed_router)
|
||||
app.include_router(tags_router)
|
||||
|
||||
# Mount static files
|
||||
static_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), "static")
|
||||
if os.path.exists(static_dir):
|
||||
app.mount("/static", StaticFiles(directory=static_dir), name="static")
|
||||
# Note: Frontend is now served separately as an Angular application
|
||||
|
||||
|
||||
@app.on_event("startup")
|
||||
@@ -69,19 +66,15 @@ async def api_root():
|
||||
|
||||
@app.get("/")
|
||||
async def ui_root():
|
||||
"""Serve the UI"""
|
||||
index_path = os.path.join(static_dir, "index.html")
|
||||
if os.path.exists(index_path):
|
||||
return FileResponse(index_path)
|
||||
else:
|
||||
return {
|
||||
"message": "Test Artifact Data Lake API",
|
||||
"version": "1.0.0",
|
||||
"docs": "/docs",
|
||||
"ui": "UI not found. Serving API only.",
|
||||
"deployment_mode": settings.deployment_mode,
|
||||
"storage_backend": settings.storage_backend
|
||||
}
|
||||
"""API root - Frontend is served separately"""
|
||||
return {
|
||||
"message": "Test Artifact Data Lake API",
|
||||
"version": "1.0.0",
|
||||
"docs": "/docs",
|
||||
"frontend": "Frontend is served separately on port 4200 (development) or via reverse proxy (production)",
|
||||
"deployment_mode": settings.deployment_mode,
|
||||
"storage_backend": settings.storage_backend
|
||||
}
|
||||
|
||||
|
||||
@app.get("/health")
|
||||
|
||||
Reference in New Issue
Block a user