update database.py and main.py

This commit is contained in:
ben
2026-08-02 20:44:38 +02:00
parent 4541d5627d
commit 8ed7993573
2 changed files with 106 additions and 3 deletions
+29 -3
View File
@@ -1,6 +1,32 @@
# Python backend for a calender for my friend group.
# We had the problem of never agreeing when or where
# we should meet up, and I hope this fixes the problem.
# we should meet up, and I hope this fixes the problem.
from fastapi import FastAPI
from database import fetch_all
app = FastAPI(
title="Calendar API",
description="Room based agenda system",
version="0.1"
)
@app.get("/")
def home():
return {
"status": "online",
"service": "Calendar API"
}
@app.get("/database")
def database_status():
tables = fetch_all(
"SELECT name FROM sqlite_master WHERE type='table';"
)
return {
"tables": [table["name"] for table in tables]
}
import fastapi
import time