init backend, fix frontend module (#307)

This commit is contained in:
Silen Naihin
2023-08-15 14:14:35 +01:00
committed by GitHub
parent c59e5fb7d8
commit 8bc3710e23
8 changed files with 37 additions and 6 deletions

17
backend/main.py Normal file
View File

@@ -0,0 +1,17 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
@app.get("/data")
async def read_data() -> dict[str, str]:
return {"data": "Hello, World!"}