initial vibecoded... thing

This commit is contained in:
cyberbread-ru
2026-05-15 16:06:28 +04:00
commit 3b8451fa1c
9 changed files with 270 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import os
import secrets
from fastapi import FastAPI
from app.routes import router
from app.store import init_db
# If no API_KEY is set, generate one and print it (first-run helper)
if not os.getenv("API_KEY"):
generated = secrets.token_urlsafe(32)
os.environ["API_KEY"] = generated
print(f"\n⚠️ No API_KEY set — using generated key for this session:")
print(f" API_KEY={generated}")
print(" Set it permanently with: export API_KEY=<your-key>\n")
app = FastAPI(title="Notepad Backup Server", version="1.0.0")
init_db()
app.include_router(router)
@app.get("/health")
def health():
return {"status": "ok"}