Moved client init to seperate file

This commit is contained in:
2023-12-28 19:14:06 +01:00
parent 83dc8f91d1
commit c63d931f8a
4 changed files with 92 additions and 46 deletions

24
src/utils/Illegitimate.ts Normal file
View File

@@ -0,0 +1,24 @@
import { ExtendedClient as Client } from "./Client"
import config from "./Config"
import { redis } from "./Redis"
import { connect } from "mongoose"
import init from "./Init"
const client = new Client()
export default class Illegitimate {
constructor() {}
async start() {
init()
client.start()
redis.on("ready", () => {
console.log("Connected to Redis")
})
connect(config.prod.mongoURI, {}).then(() => {
console.log("Connected to MongoDB")
})
}
}