chore: Add warning if mongodb url looks incorrect in install

This commit is contained in:
LaraClara 2023-06-12 13:29:01 +10:00 committed by Danny Avila
parent cefdd1fb88
commit 4c340fd0ba

View file

@ -102,6 +102,10 @@ const askQuestion = (query) => {
'What is your mongodb url? (default: mongodb://127.0.0.1:27017/LibreChat)'
);
env['MONGO_URI'] = mongodb || 'mongodb://127.0.0.1:27017/LibreChat';
// Very basic check to make sure they entered a url
if (!env['MONGO_URI'].includes('://')) {
console.warn('Warning: Your mongodb url looks incorrect, please double check it in the `.env` file.');
}
// Update the env file
loader.writeEnvFile(rootEnvPath, env);