cb6594f463
Add localhost:3001 to allowed CORS origins to fix local Docker setup where frontend is mapped to port 3001. Also update stats grid to fixed 3-column layout and reorder stat cards. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
28 lines
651 B
Python
28 lines
651 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from .database import engine, Base
|
|
from .routes import users, purchases, stats, history
|
|
|
|
Base.metadata.create_all(bind=engine)
|
|
|
|
app = FastAPI(title="BTC Portfolio API")
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["http://localhost:3000", "http://localhost:3001"],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(users.router)
|
|
app.include_router(purchases.router)
|
|
app.include_router(stats.router)
|
|
app.include_router(history.router)
|
|
|
|
|
|
@app.get("/")
|
|
def root():
|
|
return {"message": "BTC Portfolio API"}
|