Skip to content

Commit

Permalink
Check access to users db on load
Browse files Browse the repository at this point in the history
  • Loading branch information
cynicaloptimist committed Jul 26, 2024
1 parent b38f449 commit ba6cb2b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/dbconnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export const initialize = async (connectionString: string): Promise<void> => {
await mongoClient.connect();
const db = mongoClient.db();
await db.command({ ping: 1 });
const users = db.collection<User>("users");
// Ensure we can read from users
await users.findOne();
console.log("Connected successfully to database.");
return;
};
Expand Down

0 comments on commit ba6cb2b

Please sign in to comment.