33 lines
1.2 KiB
Python
33 lines
1.2 KiB
Python
from fastapi import FastAPI
|
|
from fastapi.responses import HTMLResponse
|
|
import os
|
|
|
|
app = FastAPI()
|
|
|
|
@app.get("/", response_class=HTMLResponse)
|
|
async def home():
|
|
return """<!doctype html>
|
|
<html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>Hermes Demo on Coolify</title>
|
|
<style>
|
|
body{font-family:system-ui,sans-serif;max-width:720px;margin:40px auto;padding:0 16px;line-height:1.6}
|
|
.card{border:1px solid #ddd;border-radius:12px;padding:20px;background:#fafafa}
|
|
code{background:#eee;padding:2px 6px;border-radius:4px}
|
|
</style></head><body>
|
|
<h1>Hallo from Hermes! Deployed via Gitea + Coolify</h1>
|
|
<div class="card">
|
|
<p>Project: <code>xdxzkraicftvn71gpje7mpjw</code></p>
|
|
<p>Source: <a href="https://gitea.hellobaka.com/opatel99/hermes-demo">gitea.hellobaka.com/opatel99/hermes-demo</a></p>
|
|
<p>Status: <strong>live</strong></p>
|
|
</div>
|
|
<p><a href="/health">/health</a> | <a href="/api/hello">/api/hello</a></p>
|
|
</body></html>"""
|
|
|
|
@app.get("/health")
|
|
async def health():
|
|
return {"status": "ok"}
|
|
|
|
@app.get("/api/hello")
|
|
async def hello():
|
|
return {"message": "Hello from Hermes + Coolify + Gitea", "project": "xdxzkraicftvn71gpje7mpjw"}
|