initial commit
This commit is contained in:
25
app/main.py
Normal file
25
app/main.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
from fastapi.responses import FileResponse
|
||||
|
||||
from app.api.main import api_router
|
||||
from app.core.config import settings
|
||||
|
||||
from app.core.db import init_db, engine
|
||||
|
||||
from sqlmodel import Session
|
||||
|
||||
with Session(engine) as session:
|
||||
init_db(session)
|
||||
|
||||
app = FastAPI(
|
||||
title=settings.PROJECT_NAME, openapi_url=f"{settings.API_V1_STR}/openapi.json"
|
||||
)
|
||||
|
||||
@api_router.get("/")
|
||||
def index():
|
||||
return FileResponse("app/index.html")
|
||||
|
||||
app.include_router(api_router, prefix=settings.API_V1_STR)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user