The MongoDB connection URI is currently hardcoded in the codebase. This should be moved to an environment variable to improve security and follow best practices.
Task
-
Remove the hardcoded MongoDB URI from the source code.
-
Store the URI inside the .env file.
-
Update the database connection logic to use the environment variable.
Example:
process.env.MONGODB_URI
Expected Outcome
The MongoDB connection URI is currently hardcoded in the codebase. This should be moved to an environment variable to improve security and follow best practices.
Task
Remove the hardcoded MongoDB URI from the source code.
Store the URI inside the .env file.
Update the database connection logic to use the environment variable.
Example:
process.env.MONGODB_URI
Expected Outcome
MongoDB credentials are no longer exposed in the codebase.
The application reads the database connection string from environment variables.