Is there a way to check where the nodejs connection come from?
in javascript we do
if (window.location.host == "localhost")
{
// Do whatever
}
however I have no idea how to do it in nodejs, I want to do ( then I'll only need to maintain 1 folder for the git repo )
if (window.location.host == "localhost"){
// connect to localhost mongodb
}else{
// connect to mongodb uri
}