add initial template
This commit is contained in:
parent
4ed1e88dc2
commit
45a93e5a23
13 changed files with 457 additions and 13 deletions
22
backend/main.py
Normal file
22
backend/main.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from routes import router
|
||||
|
||||
app = FastAPI(title="Simple Fullstack API")
|
||||
|
||||
# CORS per permettere richieste dal frontend
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
# Includi le route
|
||||
app.include_router(router)
|
||||
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
print("🚀 Avvio server FastAPI...")
|
||||
uvicorn.run(app, host="0.0.0.0", port=8000)
|
Loading…
Add table
Add a link
Reference in a new issue