From 16c079d2c767a3415fbd2a600c4376e1eb2ba136 Mon Sep 17 00:00:00 2001 From: proDream Date: Fri, 10 Jan 2025 02:59:00 +0400 Subject: [PATCH] =?UTF-8?q?feat:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D1=8D=D0=BD=D0=B4=D0=BF=D0=BE=D0=B8=D0=BD=D1=82?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20FastAPI=20=D1=81=D0=B5=D1=80=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Первая статья https://pressanybutton.ru/post/servis-na-fastapi/fastapi-1-inicializaciya-proekta/ - Добавлена импорт библиотеки `FastAPI`. - Создана экземпляр приложения `app` класса `FastAPI`. - Определен асинхронный GET эндпоинт `/`, который возвращает статус. --- lkeep/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lkeep/main.py b/lkeep/main.py index e69de29..1907c22 100644 --- a/lkeep/main.py +++ b/lkeep/main.py @@ -0,0 +1,8 @@ +from fastapi import FastAPI + +app = FastAPI() + + +@app.get("/") +async def index(): + return {"status": "It's ALIVE!"}