Add version number and fix warnings
This commit is contained in:
@@ -5,14 +5,15 @@ from sqlalchemy import text
|
||||
from typing import List
|
||||
import models, schemas
|
||||
from database import engine, get_db
|
||||
from version import __version__, __app_name__, __description__
|
||||
|
||||
# Create database tables
|
||||
models.Base.metadata.create_all(bind=engine)
|
||||
|
||||
app = FastAPI(
|
||||
title="Product Tracker API",
|
||||
description="API for tracking product prices and shopping events",
|
||||
version="1.0.0"
|
||||
title=__app_name__,
|
||||
description=__description__,
|
||||
version=__version__
|
||||
)
|
||||
|
||||
# CORS middleware for React frontend
|
||||
@@ -92,7 +93,7 @@ def build_shopping_event_response(event: models.ShoppingEvent, db: Session) -> s
|
||||
# Root endpoint
|
||||
@app.get("/")
|
||||
def read_root():
|
||||
return {"message": "Product Tracker API", "version": "1.0.0"}
|
||||
return {"message": __app_name__, "version": __version__, "name": "Groceries Tracker Backend"}
|
||||
|
||||
# Product endpoints
|
||||
@app.post("/products/", response_model=schemas.Product)
|
||||
|
||||
8
backend/version.py
Normal file
8
backend/version.py
Normal file
@@ -0,0 +1,8 @@
|
||||
"""
|
||||
Version configuration for Groceries Tracker Backend
|
||||
Single source of truth for version information
|
||||
"""
|
||||
|
||||
__version__ = "1.0.0"
|
||||
__app_name__ = "Groceries Tracker API"
|
||||
__description__ = "API for tracking grocery shopping events, products, and expenses"
|
||||
Reference in New Issue
Block a user