Initial commit
This commit is contained in:
25
api/rpk-api/main.py
Normal file
25
api/rpk-api/main.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
from fastapi import FastAPI
|
||||
|
||||
from hub.auth import oauth_router
|
||||
|
||||
if __name__ == '__main__':
|
||||
import uvicorn
|
||||
uvicorn.run("main:app", host='0.0.0.0', port=8000, reload=True)
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
# create_db_and_tables()
|
||||
# create_admin_user()
|
||||
yield
|
||||
# do something before end
|
||||
|
||||
app = FastAPI(root_path="/api/v1", lifespan=lifespan)
|
||||
|
||||
app.include_router(
|
||||
oauth_router,
|
||||
prefix="/auth/google",
|
||||
tags=["auth"],
|
||||
)
|
||||
Reference in New Issue
Block a user