mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-03 09:04:06 -05:00
Mount Vue Frontend only in production
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from pathlib import Path
|
||||
import os
|
||||
|
||||
import uvicorn
|
||||
from fastapi import FastAPI
|
||||
@@ -24,8 +25,10 @@ WEB_PATH = CWD.joinpath("dist")
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
# Mount Vue Frontend
|
||||
app.mount("/static", StaticFiles(directory=WEB_PATH, html=True))
|
||||
# Mount Vue Frontend only in production
|
||||
env = os.environ.get("ENV")
|
||||
if(env == "prod"):
|
||||
app.mount("/static", StaticFiles(directory=WEB_PATH, html=True))
|
||||
|
||||
# API Routes
|
||||
app.include_router(recipe_routes.router)
|
||||
|
||||
Reference in New Issue
Block a user