{"size": 278, "ext": "js", "max_stars_repo_path": "server/controllers/user.controller.js", "max_stars_repo_name": "amninderchahal/gamerlink-test", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/controllers/user.controller.js", "max_issues_repo_name": "amninderchahal/gamerlink-test", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/controllers/user.controller.js", "max_forks_repo_name": "amninderchahal/gamerlink-test", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.1666666667, "max_line_length": 58, "alphanum_fraction": 0.6043165468}
import User from '../models/user';

// Fetch user from database
export function getUser(req, res) {
  let name = req.params.username;
  User.findOne({displayName : name}).exec((err, user) => {
    if (err) {
      res.status(500).send(err);
    }
    res.json({ user });
  });
}