Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
vincelwt committed Dec 24, 2024
1 parent 3b01d5e commit 7047d27
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -915,10 +915,6 @@ async function testDatabaseConnection() {
}
}

// Wrap the server startup in an async function

await testDatabaseConnection();

// Add error event listener before calling listen
server.on("error", (err) => {
console.error("Server error:", {
Expand All @@ -930,11 +926,13 @@ server.on("error", (err) => {

server.on("listening", () => {
const address = server.address();
console.log("Server listening event triggered", address);
console.log("Server listening on:", address);
});

server.listen(PORT);

await testDatabaseConnection();

process.on("SIGINT", () => {
console.log("\nShutting down server...");
server.close();
Expand Down

0 comments on commit 7047d27

Please sign in to comment.