2022-01-12 07:48:18 +00:00
|
|
|
from fastapi import FastAPI, Depends
|
|
|
|
from app import auth, user, server
|
2022-01-13 03:11:59 +00:00
|
|
|
from os import getenv
|
2021-09-12 08:45:44 +00:00
|
|
|
app = FastAPI()
|
|
|
|
|
2022-01-13 03:11:59 +00:00
|
|
|
dependencies = list()
|
|
|
|
if not getenv('DISABLE_AUTH'):
|
|
|
|
dependencies.append(Depends(auth.authorise))
|
2022-01-12 07:48:18 +00:00
|
|
|
app.include_router(auth.router)
|
|
|
|
app.include_router(user.router)
|
2022-01-13 03:11:59 +00:00
|
|
|
app.include_router(server.router, dependencies=dependencies)
|