update root page
This commit is contained in:
+14
-2
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user