Ihorog commited on
Commit
85efb22
·
verified ·
1 Parent(s): c8a81b2

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI, Request
2
+ from ci_trigger_engine import trigger_engine
3
+ from ci_sync_monitor import sync_monitor
4
+
5
+ app = FastAPI()
6
+ inputs = []
7
+
8
+ @app.post("/inputs")
9
+ async def receive_input(req: Request):
10
+ data = await req.json()
11
+ inputs.append(data)
12
+ trigger_engine.add_input(data)
13
+ sync_monitor.log_event(data)
14
+ sync_monitor.check_alignment(data)
15
+ return {"status": "received"}
16
+
17
+ @app.get("/inputs")
18
+ async def get_all():
19
+ return inputs
20
+
21
+ @app.get("/health")
22
+ def health_check():
23
+ return {"status": "ok"}