Files
calendar/backend/main.py
T
2026-08-02 20:44:38 +02:00

33 lines
651 B
Python

# 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.
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]
}