diff --git a/app/api/routes.py b/app/api/routes.py index 954279b..285daef 100644 --- a/app/api/routes.py +++ b/app/api/routes.py @@ -22,47 +22,3 @@ router.include_router(health_router) router.include_router(echo_router) - - - - -@router.get("/") -def root(conn=Depends(get_db_connection)) -> dict: - """Return a structured welcome message for the API root, including product data.""" - cur = conn.cursor() - try: - cur.execute('SELECT id, name, description, price, in_stock, created_at FROM product;') - products = [ - { - "id": row[0], - "name": row[1], - "description": row[2], - "price": str(row[3]) if row[3] is not None else None, - "in_stock": row[4], - "created_at": row[5].isoformat() if row[5] else None, - } - for row in cur.fetchall() - ] - finally: - cur.close() - epoch = int(time.time() * 1000) - meta = { - "version": __version__, - "time": time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), - "epoch": epoch, - "severity": "success", - "message": f"NX AI says hello. Returned {len(products)} products.", - } - return {"meta": meta, "data": products} - - -@router.get("/health") -def health() -> dict[str, str]: - """Return the health status of the application.""" - return {"status": "ok"} - - -@router.post("/echo", response_model=EchoResponse) -def echo(body: EchoRequest) -> EchoResponse: - """Echo the provided message back to the caller.""" - return EchoResponse(echo=body.message)