mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: init login & register from frontend
This commit is contained in:
parent
67ce2e7371
commit
8cc727e309
8 changed files with 90 additions and 14 deletions
18
app.py
18
app.py
|
|
@ -1,9 +1,7 @@
|
|||
from typing import Union
|
||||
from fastapi import FastAPI
|
||||
from src import main
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from src.main import global_router
|
||||
import pymongo
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
|
||||
# Init
|
||||
app = FastAPI(
|
||||
|
|
@ -12,9 +10,19 @@ app = FastAPI(
|
|||
version="0.1.0",
|
||||
root_path="/"
|
||||
)
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_methods=["*"],
|
||||
allow_credentials=True,
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
app.include_router(global_router)
|
||||
|
||||
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
return {"Message": "Welcome to LearnHouse ✨"}
|
||||
return {"Message": "Welcome to LearnHouse ✨"}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue