init commit
This commit is contained in:
41
.history/app/api/main_20251210201725.py
Normal file
41
.history/app/api/main_20251210201725.py
Normal file
@@ -0,0 +1,41 @@
|
||||
"""FastAPI application"""
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from app.core.config import get_settings
|
||||
|
||||
settings = get_settings()
|
||||
|
||||
app = FastAPI(
|
||||
title="Finance Bot API",
|
||||
description="REST API for family finance management",
|
||||
version="0.1.0"
|
||||
)
|
||||
|
||||
# CORS middleware
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
|
||||
@app.get("/health")
|
||||
async def health_check():
|
||||
"""Health check endpoint"""
|
||||
return {
|
||||
"status": "ok",
|
||||
"environment": settings.app_env
|
||||
}
|
||||
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
"""Root endpoint"""
|
||||
return {
|
||||
"message": "Finance Bot API",
|
||||
"docs": "/docs",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
Reference in New Issue
Block a user