summary refs log tree commit diff
path: root/api/scripts/globalSetup.js
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-02 00:14:34 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-02 00:14:34 +0200
commitf056885fb087d4c6b8dcf19d68d0c9871f3e8609 (patch)
treeb6b46f18cc9583625d5cfd37301896d081144f7f /api/scripts/globalSetup.js
parent:arrow_up: update dependencies (diff)
parentadded /login unittest (diff)
downloadserver-f056885fb087d4c6b8dcf19d68d0c9871f3e8609.tar.xz
Merge branch 'master' of https://github.com/fosscord/fosscord-api
Diffstat (limited to 'api/scripts/globalSetup.js')
-rw-r--r--api/scripts/globalSetup.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/api/scripts/globalSetup.js b/api/scripts/globalSetup.js
new file mode 100644

index 00000000..76cd8e0d --- /dev/null +++ b/api/scripts/globalSetup.js
@@ -0,0 +1,14 @@ +const fs = require("fs"); +const { FosscordServer } = require("../dist/Server"); +const Server = new FosscordServer({ port: 3001 }); +global.server = Server; +module.exports = async () => { + try { + fs.unlinkSync(`${__dirname}/../database.db`); + } catch {} + return await Server.start(); +}; + +// afterAll(async () => { +// return await Server.stop(); +// });