From f02c4054984fb8c12bfa4af9560a5b2be38810c0 Mon Sep 17 00:00:00 2001 From: LarsVomMars Date: Thu, 30 Jul 2020 20:16:54 +0200 Subject: Added views and server setup --- src/util/server.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/util/server.ts (limited to 'src/util/server.ts') diff --git a/src/util/server.ts b/src/util/server.ts new file mode 100644 index 0000000..665c14f --- /dev/null +++ b/src/util/server.ts @@ -0,0 +1,14 @@ +import DBController from "../db/DBController.ts"; +import * as log from "https://deno.land/std/log/mod.ts"; + +const controller = new DBController(); + +export const isSetup = async (): Promise => { + try { + const users = await controller.query("SELECT id FROM users"); + return users.length > 0 + } catch (e) { + log.error(e); + return false; + } +} -- cgit v1.2.3