mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-10 20:52:42 +01:00
switch to mongoose
This commit is contained in:
parent
f5269ef39e
commit
fb4502bb68
@ -12,11 +12,12 @@ export class Server {
|
|||||||
|
|
||||||
async setupSchema() {
|
async setupSchema() {
|
||||||
// TODO: adjust expireAfterSeconds -> lower
|
// TODO: adjust expireAfterSeconds -> lower
|
||||||
await db.conn.db.collection("events").createIndex({ created_at: 1 }, { expireAfterSeconds: 60 });
|
await db.collection("events").createIndex({ created_at: 1 }, { expireAfterSeconds: 60 });
|
||||||
}
|
}
|
||||||
|
|
||||||
async listen(): Promise<void> {
|
async listen(): Promise<void> {
|
||||||
await db.init();
|
// @ts-ignore
|
||||||
|
await (db as Promise<Connection>);
|
||||||
await this.setupSchema();
|
await this.setupSchema();
|
||||||
await Config.init();
|
await Config.init();
|
||||||
console.log("listening");
|
console.log("listening");
|
||||||
|
Loading…
Reference in New Issue
Block a user