{"size": 619, "ext": "js", "max_stars_repo_path": "routes/index.js", "max_stars_repo_name": "RodrigoDev/Expresso", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "routes/index.js", "max_issues_repo_name": "RodrigoDev/Expresso", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "routes/index.js", "max_forks_repo_name": "RodrigoDev/Expresso", "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": 22.1071428571, "max_line_length": 55, "alphanum_fraction": 0.5848142165}
var express = require('express');
var User = require('../app/models/user');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res) {
    res.send('Hello! The API is at http://localhost/');
});

router.get('/setup', function(req, res){
    // create a sample user
    var user = new User({
       name: 'Rodrigo Carneiro',
       password: 'password',
       admin: true
    });

    // save the sample user
    user.save(function(err) {
       if (err) throw err;

       console.log('User saved successfully');
       res.json({ success: true });
    });
});

module.exports = router;
