feat: use Next.js 13 App directory

This commit is contained in:
swve 2023-01-08 21:32:12 +01:00
parent cb3fc9a488
commit 379a0e9859
28 changed files with 418 additions and 295 deletions

15
app.py
View file

@ -9,12 +9,12 @@ from src.services.mocks.initial import create_initial_data
########################
# Pre-Alpha Version 0.1.0
# Author: @swve
# (c) LearnHouse 2022
# Author: @swve
# (c) LearnHouse 2022
########################
# Global Config
# Global Config
app = FastAPI(
title="LearnHouse",
description="LearnHouse is a new open-source platform tailored for learning experiences.",
@ -33,21 +33,26 @@ app.add_middleware(
app.mount("/content", StaticFiles(directory="content"), name="content")
# Exception Handler
@app.exception_handler(AuthJWTException)
def authjwt_exception_handler(request: Request, exc: AuthJWTException):
return JSONResponse(
status_code=exc.status_code, # type: ignore
content={"detail": exc.message} # type: ignore
content={"detail": exc.message} # type: ignore
)
app.include_router(global_router)
@app.get("/")
async def root():
return {"Message": "Welcome to LearnHouse ✨"}
@app.get("/initial_data")
async def initial_data():
await create_initial_data()
return {"Message": "Initial data created 🤖"}