From 06637907b6cd16bf611bf2ff42b468e53c4c2f82 Mon Sep 17 00:00:00 2001 From: Rohit Singh Date: Thu, 23 Jan 2025 21:31:04 +0530 Subject: [PATCH] fix mongodb connection - alogin --- .../functions/src/logger/authLogger.ts | 4 +--- launch.sh | 14 ++------------ 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/backend/microservices/user-service/functions/src/logger/authLogger.ts b/backend/microservices/user-service/functions/src/logger/authLogger.ts index 0eab9e9..f6c47b7 100644 --- a/backend/microservices/user-service/functions/src/logger/authLogger.ts +++ b/backend/microservices/user-service/functions/src/logger/authLogger.ts @@ -25,9 +25,7 @@ const connectMongoDB = async () => { } }; -// Initialize connection -// Make this export so we can properly test it -export const initMongoDB = () => connectMongoDB(); +connectMongoDB(); // Auth Log Schema remains the same... const authLogSchema = new mongoose.Schema({ diff --git a/launch.sh b/launch.sh index 16b2336..c250bb1 100755 --- a/launch.sh +++ b/launch.sh @@ -1,6 +1,6 @@ #!/bin/bash -./env-fetch.sh +#./env-fetch.sh # Color codes for better visibility RED='\033[0;31m' GREEN='\033[0;32m' @@ -23,17 +23,7 @@ check_directory() { # Function to install dependencies install_dependencies() { log "${YELLOW}Installing dependencies in $(pwd)...${NC}" - if [ "$EUID" -ne 0 ]; then - echo "Some installations may require elevated privileges..." - if command -v sudo >/dev/null 2>&1; then - sudo -S npm install - else - echo "sudo is not installed. Please run this script with root privileges or install sudo" - exit 1 - fi - else - npm install - fi + npm install } # Store the root directory