Compare commits

...
2 Commits
Author SHA1 Message Date
brb ed05a8eca5 update root page 2023-07-06 13:20:24 +02:00
brb 02ec54fd16 updated response text 2023-07-06 13:15:16 +02:00
+17 -3
View File
@@ -1,5 +1,6 @@
import uvicorn
from fastapi import FastAPI, Request, HTTPException
from fastapi.responses import HTMLResponse
from dotenv import load_dotenv
import logging
from typing import List
@@ -11,9 +12,20 @@ from gitea_request import GiteaRequest
app = FastAPI()
@app.get('/')
@app.get('/', response_class=HTMLResponse)
async def root():
return '<h1>Welcome to Gitea Runsner</h1>'
content_str = """
<html>
<head>
<title>Gitea Runner</title>
</head>
<body>
<h1>Welcome to Gitea Runner</h1>
<p>see /docs for more information</p>
</body>
</html>
"""
return HTMLResponse(content=content_str, status_code=200)
@app.post('/test')
async def test(request: Request):
@@ -44,8 +56,10 @@ def handle_event(request: GiteaRequest):
if not runner_script_path.exists():
raise HTTPException(
status_code=200,
detail='no "runner_script.yml" in repository root'
detail="no runner_script.yml in repository root"
)
# load runner commands
# send response
raise HTTPException(