Migrate pre-1.6 DEVMODE to fastapi_vue.env with in-place patching, run uv sync after dependency changes.
This commit is contained in:
@@ -5,8 +5,7 @@ import argparse
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import fastapi_vue
|
||||
from fastapi_vue import server
|
||||
from fastapi_vue import env, server
|
||||
|
||||
DEFAULT_PORT = TEMPLATE_DEFAULT_PORT
|
||||
os.environ["FASTAPI_VUE"] = "ENVPREFIX"
|
||||
@@ -27,7 +26,7 @@ def main() -> None:
|
||||
listen=args.listen,
|
||||
default_port=DEFAULT_PORT,
|
||||
server_header=False,
|
||||
reload=Path(__file__).parent if fastapi_vue.env.dev else False,
|
||||
reload=Path(__file__).parent if env.dev else False,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ from collections.abc import AsyncGenerator
|
||||
from contextlib import asynccontextmanager
|
||||
from pathlib import Path
|
||||
|
||||
import fastapi_vue
|
||||
from fastapi import FastAPI
|
||||
from fastapi_vue import Frontend, env
|
||||
|
||||
# Vue Frontend static files
|
||||
frontend = fastapi_vue.Frontend(Path(__file__).with_name("frontend-build"))
|
||||
frontend = Frontend(Path(__file__).with_name("frontend-build"))
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
@@ -18,7 +18,7 @@ async def lifespan(_app: FastAPI) -> AsyncGenerator:
|
||||
yield
|
||||
|
||||
|
||||
app = FastAPI(title="PROJECT_TITLE", debug=fastapi_vue.env.dev, lifespan=lifespan)
|
||||
app = FastAPI(title="PROJECT_TITLE", debug=env.dev, lifespan=lifespan)
|
||||
|
||||
|
||||
# Add API routes here...
|
||||
|
||||
Reference in New Issue
Block a user