aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorLarsVomMars2020-07-30 20:16:54 +0200
committerLarsVomMars2020-07-30 20:16:54 +0200
commitf02c4054984fb8c12bfa4af9560a5b2be38810c0 (patch)
treed4519a92b739640e061847831d221e3e2488a83c /src/util
parent86c68c3648c94ca9f66f3eb408973368bed28681 (diff)
Added views and server setup
Diffstat (limited to 'src/util')
-rw-r--r--src/util/server.ts14
1 files changed, 14 insertions, 0 deletions
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<boolean> => {
+ try {
+ const users = await controller.query("SELECT id FROM users");
+ return users.length > 0
+ } catch (e) {
+ log.error(e);
+ return false;
+ }
+}