summaryrefslogtreecommitdiff
path: root/__main__.py
diff options
context:
space:
mode:
authorBotond Hende <nettingman@gmail.com>2024-08-25 14:13:21 +0200
committerBotond Hende <nettingman@gmail.com>2024-08-25 14:13:21 +0200
commitea2da15f2b04e3b4febf2230d4fbb0e2d6147dfc (patch)
tree51cbf662ab104e1b8c3bdde8b7c4f20542146006 /__main__.py
parent0a748763535dd184926969cfdc3d439a1b8bc9e9 (diff)
fastapi testing
Diffstat (limited to '__main__.py')
-rw-r--r--__main__.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/__main__.py b/__main__.py
index 46d2815..16b0f63 100644
--- a/__main__.py
+++ b/__main__.py
@@ -1,10 +1,19 @@
import os.path
+from fastapi import FastAPI
+from .datatemplates.agent_id import AgentId
from .modules import daemon
from .config import Config
-if __name__ == "__main__":
- with open(os.path.join(os.path.dirname(__file__), Config.TOKEN_FILE_NAME)) as f:
- token = f.read().strip()
+app = FastAPI()
- d = daemon.Daemon(Config.AGENT_SYMBOL, token)
- d.run()
+
+@app.post("/tasks")
+async def get_tasks(agent_id: AgentId):
+ return "foo"
+
+# if __name__ == "__main__":
+# with open(os.path.join(os.path.dirname(__file__), Config.TOKEN_FILE_NAME)) as f:
+# token = f.read().strip()
+#
+# d = daemon.Daemon(Config.AGENT_SYMBOL, token)
+# d.run()