User Auth Done
This commit is contained in:
26
backend/app/main.py
Normal file
26
backend/app/main.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from app.api import auth, scanner
|
||||
from app.db.database import engine, Base
|
||||
|
||||
# Initialize the database tables
|
||||
Base.metadata.create_all(bind=engine)
|
||||
|
||||
app = FastAPI(title="Stock Scanner Pro API")
|
||||
|
||||
# Configure CORS for frontend access
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
# Include Routers
|
||||
app.include_router(auth.router, prefix="/api/auth", tags=["auth"])
|
||||
app.include_router(scanner.router, prefix="/api/scanner", tags=["scanner"])
|
||||
|
||||
@app.get("/")
|
||||
def read_root():
|
||||
return {"message": "Stock Scanner Backend is running."}
|
||||
Reference in New Issue
Block a user