{"size": 610, "ext": "js", "max_stars_repo_path": "front/controllers/artists-controller.js", "max_stars_repo_name": "MINE4201grupo2/sr_taller_1", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "front/controllers/artists-controller.js", "max_issues_repo_name": "MINE4201grupo2/sr_taller_1", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "front/controllers/artists-controller.js", "max_forks_repo_name": "MINE4201grupo2/sr_taller_1", "max_forks_repo_forks_event_min_datetime": "2021-03-17T06:28:04.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-17T06:28:04.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 32.1052631579, "max_line_length": 90, "alphanum_fraction": 0.5704918033}

 
module.exports.listArtists= function(req,res){
  if(req.session.loggedin){
    const connection = require('./../db');
    connection.query('SELECT * FROM artists limit 50', function (error, results, fields) {
      if (error) {
	  		res.status(500).json({"status_code": 500,"status_message": "internal server error"});
	  	} else {
        res.render('pages/recomendations/preferences',{title: 'getArtists',
                            userProfile: { email: req.session.email },
                            artists: results}
                  );
      }

    });
  }else{res.redirect('/iniciar-sesion');}
}
