Skip to content
Sign upLog in
← Back to Community
how to connect a mongodb altas to expreesss
Profile icon
lokeshvirtusa

can you help anyone to fix it.
mongoclient error occured

Voters
Profile icon
JaphetDamassoh
Profile icon
lokeshvirtusa
Comments
hotnewtop
Profile icon
marlonlom

let me think about it...
q: do you control that when database is connected, the express server starts?
the lines 168+ is mm a little 'ok'... but, when accesing the endpoints, as your code shows, you must call the database connection function every time it access an endpoint :S

Profile icon
Grify

Let me ask my friend who knows Node quite well

hey

@MrEconomical
, fancy 5 cycles?

Profile icon
eco27

@Grify

  1. I don't use mongo
  2. I don't use atlas
  3. I don't use express
    hmmm
Profile icon
Grify

@MrEconomical
wait you don't use express? I thought l/thanks-mreco was express lol