summaryrefslogtreecommitdiff
path: root/__main__.py
diff options
context:
space:
mode:
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()