added env variable

This commit is contained in:
Hayden
2021-01-07 19:54:17 -09:00
parent 78758e1026
commit f412c3dd5b
3 changed files with 17 additions and 2 deletions

View File

@@ -15,13 +15,19 @@ from routes import (
user_routes,
)
from routes.setting_routes import scheduler # ! This has to be imported for scheduling
from settings import PORT, PRODUCTION
from settings import PORT, PRODUCTION, docs_url, redoc_url
from utils.logger import logger
CWD = Path(__file__).parent
WEB_PATH = CWD.joinpath("dist")
app = FastAPI()
app = FastAPI(
title="Mealie",
description="A place for all your recipes",
version="0.0.1",
docs_url=docs_url,
redoc_url=redoc_url,
)
# Mount Vue Frontend only in production

View File

@@ -10,6 +10,14 @@ dotenv.load_dotenv(ENV)
# General
PRODUCTION = os.environ.get("ENV")
PORT = int(os.getenv("mealie_port", 9000))
API = os.getenv("api_docs", True)
if API:
docs_url = "/docs"
redoc_url = "/redoc"
else:
docs_url = None
redoc_url = None
# Mongo Database
MEALIE_DB_NAME = os.getenv("mealie_db_name", "mealie")