-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
3,427 additions
and
915 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,27 @@ | ||
console.log("Hello"); | ||
import { initMikro } from "./utils/init-mikro"; | ||
import { initMongo } from "./utils/init-mongo"; | ||
import type { Queuer } from "core/types/queuer"; | ||
import { createDataMapper } from "./utils/create-data-mapper"; | ||
import type { Db } from "mongodb"; | ||
import type { MikroORM } from "@mikro-orm/core"; | ||
|
||
new Promise((resolve) => setTimeout(resolve, 1500)).then(async () => { | ||
const db: Db = await initMongo(); | ||
const orm: MikroORM = await initMikro(); | ||
|
||
const queuer: Queuer = { | ||
publicKey: "PublicKey", | ||
nickname: "Nickname", | ||
createdAt: new Date().toISOString(), | ||
}; | ||
|
||
const dataMapper = createDataMapper(orm, db); | ||
await dataMapper.createQueuer(queuer); | ||
const queuers = await dataMapper.readQueuers(); | ||
|
||
if (!queuers) { | ||
throw new Error("No queuers found !"); | ||
} | ||
|
||
console.log("Success !"); | ||
}); |
Oops, something went wrong.