import { defineEventHandler } from "h3"; import { database } from "../utils/database"; export async function isFirstRun() { try { const numberOfUsers = await database.user.count(); return numberOfUsers === 0; } catch { // We could fall here if the database is not initialized return true; } } export default defineEventHandler((e) => { return isFirstRun(); });