2021-09-20 23:35:37 +02:00
|
|
|
const { Config, initDatabase } = require("@fosscord/util");
|
2021-09-18 01:50:29 +02:00
|
|
|
const fs = require("fs");
|
|
|
|
const path = require("path");
|
|
|
|
const { FosscordServer } = require("../dist/Server");
|
|
|
|
const Server = new FosscordServer({ port: 3001 });
|
|
|
|
global.server = Server;
|
|
|
|
module.exports = async () => {
|
|
|
|
try {
|
2021-09-20 23:35:37 +02:00
|
|
|
fs.unlinkSync(path.join(process.cwd(), "database.db"));
|
2021-09-18 01:50:29 +02:00
|
|
|
} catch {}
|
2021-09-20 23:35:37 +02:00
|
|
|
|
|
|
|
await initDatabase();
|
|
|
|
await Config.init();
|
|
|
|
Config.get().limits.rate.disabled = true;
|
2021-09-18 01:50:29 +02:00
|
|
|
return await Server.start();
|
|
|
|
};
|
|
|
|
|
|
|
|
// afterAll(async () => {
|
|
|
|
// return await Server.stop();
|
|
|
|
// });
|