api gateway example done | maybe need some cleanup
This commit is contained in:
+5
-3
@@ -2,12 +2,14 @@
|
||||
Второй микросервис - Service 2
|
||||
Предоставляет API для управления заказами и продуктами
|
||||
"""
|
||||
from fastapi import FastAPI, HTTPException
|
||||
from pydantic import BaseModel
|
||||
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
import logging
|
||||
|
||||
from fastapi import FastAPI, HTTPException
|
||||
from pydantic import BaseModel
|
||||
|
||||
app = FastAPI(
|
||||
title="Service 2 - Order Service",
|
||||
description="Микросервис для управления заказами и продуктами",
|
||||
@@ -78,7 +80,7 @@ async def root():
|
||||
@app.get("/health", tags=["Health"])
|
||||
async def health_check():
|
||||
"""Health check endpoint"""
|
||||
return {"status": "healthy", "service": "order-service"}
|
||||
return {"status": "healthy", "service": "order-service", "random-info": "yep"}
|
||||
|
||||
# Endpoints для продуктов
|
||||
@app.get("/products", response_model=List[Product], tags=["Products"])
|
||||
|
||||
Reference in New Issue
Block a user