partial deployment
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
from fastapi import FastAPI
|
||||
from sys import argv
|
||||
from exceptions import bad_key
|
||||
|
||||
from repos.api_keys import ApiKeyRepo
|
||||
|
||||
from routers.prefixes import prefix_router
|
||||
from routers.tickets import ticket_router
|
||||
@@ -16,6 +19,12 @@ if argv[1] == "run":
|
||||
else:
|
||||
app = FastAPI(title="TAM3 API Server")
|
||||
|
||||
@app.get("/api/")
|
||||
def remote_check(api_key: str = ""):
|
||||
if not ApiKeyRepo().check_api(api_key):
|
||||
return {"status": "healthy", "auth": False, "whoami": "TAM3 Server"}
|
||||
return {"status": "healthy", "auth": True, "whoami": "TAM3 Server"}
|
||||
|
||||
app.include_router(prefix_router)
|
||||
app.include_router(ticket_router)
|
||||
app.include_router(basket_router)
|
||||
|
||||
Reference in New Issue
Block a user