summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/__init__.py2
-rw-r--r--modules/daemon.py10
2 files changed, 10 insertions, 2 deletions
diff --git a/modules/__init__.py b/modules/__init__.py
index e69de29..d593ada 100644
--- a/modules/__init__.py
+++ b/modules/__init__.py
@@ -0,0 +1,2 @@
+from fastapi import FastAPI
+app = FastAPI() \ No newline at end of file
diff --git a/modules/daemon.py b/modules/daemon.py
index a78e70b..085a7f6 100644
--- a/modules/daemon.py
+++ b/modules/daemon.py
@@ -1,10 +1,12 @@
import openapi_client
+from fastapi import FastAPI
from pprint import pprint
-class Daemon():
+fast_api = FastAPI()
+class Daemon:
def __init__(self, agent_symbol, token):
- config = openapi_client.Configuration(access_token = token)
+ config = openapi_client.Configuration(access_token=token)
self.api_client = openapi_client.ApiClient(config)
self.agents_api = openapi_client.AgentsApi(self.api_client)
@@ -13,6 +15,10 @@ class Daemon():
self.agent_symbol = agent_symbol
+ @fast_api.get("/")
+ def foo(self):
+ return "hello"
+
def run(self):
try:
api_response = self.agents_api.get_agent(self.agent_symbol)