Skip to content
Snippets Groups Projects
Commit 32f94ccf authored by Jeremy M Fee's avatar Jeremy M Fee
Browse files

api: logging environment variable for webservice

parent d7b517ae
No related branches found
No related tags found
1 merge request!193Api hotfix sqlalchemy
...@@ -6,13 +6,19 @@ and can be run using uvicorn, or any other ASGI server: ...@@ -6,13 +6,19 @@ and can be run using uvicorn, or any other ASGI server:
uvicorn geomagio.api:app uvicorn geomagio.api:app
""" """
import logging
import os
from fastapi import FastAPI from fastapi import FastAPI
from starlette.responses import RedirectResponse from starlette.responses import RedirectResponse
from . import secure, ws
from .db import database from .db import database
from . import secure
from . import ws
# configure logging
DEBUG = os.getenv('DEBUG', 'false')
LOG_LEVEL = logging.DEBUG if DEBUG == "true" else logging.INFO
logging.basicConfig(level=LOG_LEVEL)
app = FastAPI() app = FastAPI()
app.mount("/ws/secure", secure.app) app.mount("/ws/secure", secure.app)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment