aboutsummaryrefslogtreecommitdiff
path: root/src/util/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/server.ts')
-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;
+ }
+}