mirror of
https://gitlab.com/2-chainz/2chainz.git
synced 2025-07-26 08:11:22 +00:00
Accidentally didn't push this stuff and deleted it last night lol
This commit is contained in:
22
src/two_chainz/__init__.py
Normal file
22
src/two_chainz/__init__.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import time
|
||||
from datetime import datetime
|
||||
from fastapi import FastAPI
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
|
||||
|
||||
|
||||
app = FastAPI()
|
||||
start_time = time.time()
|
||||
|
||||
@app.get("/api/")
|
||||
async def ping():
|
||||
return {
|
||||
"status": "ok",
|
||||
"timestamp": datetime.now().isoformat(),
|
||||
"uptime_seconds": round(time.time() - start_time, 2),
|
||||
}
|
||||
|
||||
|
||||
# Mount static files
|
||||
app.mount("/", StaticFiles(directory="website", html=True), name="static")
|
Reference in New Issue
Block a user