change main.py

This commit is contained in:
zhangxunhui 2021-08-15 21:27:56 +08:00
parent a41b6d7bc4
commit 17e6ea49fa
1 changed files with 4 additions and 3 deletions

View File

@ -1,10 +1,10 @@
import re, sys, pathlib
import re, sys, pathlib, asyncio
sys.path.append(str(pathlib.Path(__file__).resolve().parents[1]))
import json5 as json
from wsgiref.simple_server import make_server
from app.services.comments import return_pr_decision
from app.services.triggers import parseTriggers
from app.models.trigger import Trigger
from wsgiref.simple_server import make_server
def application(environ, start_response) -> bytearray:
start_response('200 OK', [('Content-Type', 'application/json')])
@ -17,12 +17,13 @@ def application(environ, start_response) -> bytearray:
trigger: Trigger = parseTriggers(json_dict)
return_pr_decision(trigger)
# return_pr_decision(trigger)
return ["success".encode('utf-8')]
if __name__ == "__main__":
port = 4567
httpd = make_server("0.0.0.0", port , application)
print("serving http on port {0}...".format(str(port)))