hiteshchoudhary / chai-backend

A video series on chai aur code youtube channel
4.74k stars 705 forks source link

error in addressing database name #153

Open Adi9425 opened 1 month ago

Adi9425 commented 1 month ago

src/db/index.js in line 7 "${process.env.MONGODB_URI}/${DB_NAME})" , this " / " give error by connecting the database so just remove it and it would be life "${process.env.MONGODB_URI}/${DB_NAME})" --> before "${process.env.MONGODB_URI}${DB_NAME})" --> after

lovishGIT commented 1 month ago

use `` backticks instead of " or ' when u want ${} syntax in your string.

SUJEET7488 commented 1 month ago

use template literals concept here const connection= `${process.env.MONGODB_URL}${DB_NAME}`