From 78e027a68a4fbe0f28445a1c351605a8a4531c57 Mon Sep 17 00:00:00 2001 From: lAmeR <42315864+lAmeR1@users.noreply.github.com> Date: Wed, 8 Feb 2023 22:03:43 +0100 Subject: [PATCH] versioning via file --- server.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index fb865f4..ab08036 100644 --- a/server.py +++ b/server.py @@ -15,10 +15,17 @@ sio = socketio.AsyncServer(async_mode="asgi", cors_allowed_origins=[]) socket_app = socketio.ASGIApp(sio) +try: + with open("VERSION", "r") as f: + release_version = f.read() +except FileNotFoundError: + release_version = "x.x.x" + + app = FastAPI( title="Kaspa REST-API server", description="This server is to communicate with kaspa network via REST-API", - version=os.getenv("RELEASE_VERSION", "x.x.x"), + version=release_version, contact={ "name": "lAmeR1" },