-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (29 loc) · 870 Bytes
/
main.py
File metadata and controls
36 lines (29 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from dotenv import load_dotenv
import os
# Import routes
from backend.routes import auth, reports
# Load environment variables
load_dotenv()
# Initialize FastAPI app
app = FastAPI(
title="Stock Market Analysis Platform",
description="API for stock market data analysis and user management",
version="1.0.0"
)
# Configure CORS
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# Include routers
app.include_router(auth.router, prefix="/auth", tags=["Authentication"])
app.include_router(reports.router, prefix="/reports", tags=["Reports"])
# Health check endpoint
@app.get("/")
async def root():
return {"status": "healthy", "message": "Stock Market Analysis Platform API"}