From 268f6157b21c327a9341dd6315691ef835d13d57 Mon Sep 17 00:00:00 2001 From: SnehitR Date: Wed, 4 Feb 2026 21:57:16 +0530 Subject: [PATCH 1/4] firstcommit --- .github/workflows/test.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..399654c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,21 @@ +name: Test Project + +on: + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + container: + image: node:20 + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + node-version: '20' + -run: npm ci + -run: npm test + -run: npm run build + \ No newline at end of file From 05b51bf48f1085f25bd263db50c3dbe0a5846bd0 Mon Sep 17 00:00:00 2001 From: SnehitR Date: Wed, 4 Feb 2026 22:03:12 +0530 Subject: [PATCH 2/4] First commit --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 399654c..d713ff4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v3 with: node-version: '20' - -run: npm ci - -run: npm test - -run: npm run build + - run: npm ci + - run: npm test + - run: npm run build \ No newline at end of file From c4901a845d914037bca48337a2e821e1cf0d087e Mon Sep 17 00:00:00 2001 From: SnehitR Date: Wed, 4 Feb 2026 22:10:50 +0530 Subject: [PATCH 3/4] 2 commit --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d713ff4..5bd561f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,10 +11,9 @@ jobs: container: image: node:20 steps: - - name: Checkout code - uses: actions/checkout@v3 + - uses: actions/checkout@v3 with: - node-version: '20' + node-version: 20 - run: npm ci - run: npm test - run: npm run build From baf5066d20ca6d563fbfa33aff0c7a967c807e75 Mon Sep 17 00:00:00 2001 From: SnehitR Date: Wed, 4 Feb 2026 22:19:49 +0530 Subject: [PATCH 4/4] Change error handling on database connection failure Throw an error instead of exiting the process on database connection failure. --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 71ad74c..73a2ff4 100755 --- a/src/index.ts +++ b/src/index.ts @@ -33,7 +33,8 @@ async function startServer() { }); } catch (error) { console.error("Failed to connect to the database:", error); - process.exit(1); + // Instead of process.exit(1); + throw new Error("Failed to connect to the database: " + error); } } @@ -44,4 +45,4 @@ function stop() { export { server, startServer, stop }; -startServer(); \ No newline at end of file +startServer();