Bedingte Anweisung für Knoten im Internet und Knoten lokaler Server


if(os.hostname().indexOf("local") > -1){
  const DATABASE = 'local_database';
  var options = {
    host: 'localhost',
    port: 8889,
    user: 'root',
    password: 'root',
    database: DATABASE
  };
}else{
   const DATABASE = 'online_database';
  var options = {
    host: 'localhost',
    port: 3306,
    user: 'online_username',
    password: 'online_password',
    database: DATABASE
  };
}
Dan George