diff --git a/site/api/http_client.py b/site/api/http_client.py index bc50fd8..9de0cfc 100644 --- a/site/api/http_client.py +++ b/site/api/http_client.py @@ -15,3 +15,9 @@ class HttpClient: r = self._session.get(f"{self._endpoint}{path}", **kwargs) r.raise_for_status() return r.json() + + def post(self, path, data=None, **kwargs): + kwargs.setdefault("timeout", 30) + r = self._session.post(f"{self._endpoint}{path}", json=data, **kwargs) + r.raise_for_status() + return r.json() diff --git a/site/app.py b/site/app.py index 7a31930..f4a23ee 100644 --- a/site/app.py +++ b/site/app.py @@ -6,7 +6,7 @@ from routes.main import bp as main_bp from routes.api import bp as api_bp from routes.api_test import bp as api_test_bp -VERSION = "1.0.6" +VERSION = "1.0.7" app = Flask(__name__, template_folder="templates", static_folder="static") app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-dev.ngcloud.ru/api/v1/svc") diff --git a/site/templates/index.html b/site/templates/index.html index 0683038..1615c61 100644 --- a/site/templates/index.html +++ b/site/templates/index.html @@ -94,11 +94,17 @@