{"size": 1078, "ext": "js", "max_stars_repo_path": "modules/lists/server/routes/lists.server.routes.js", "max_stars_repo_name": "Insight-Heroes/ih", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "modules/lists/server/routes/lists.server.routes.js", "max_issues_repo_name": "Insight-Heroes/ih", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "modules/lists/server/routes/lists.server.routes.js", "max_forks_repo_name": "Insight-Heroes/ih", "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": 29.1351351351, "max_line_length": 82, "alphanum_fraction": 0.659554731}
'use strict';

/**
 * Module dependencies
 */
var listsPolicy = require('../policies/lists.server.policy'),
    path = require('path'),
    lists = require('../controllers/lists.server.controller');
var utils = require(path.resolve('./modules/core/server/utilities/utils.server'));

module.exports = function(app) {
    // Lists Routes
    app.route('/api/lists').all(utils.authenticate)
        .get(lists.list)
        .post(lists.create);

    app.route('/api/lists/publish_survey')
        .get(utils.authenticate, lists.published)
        .post(utils.authenticate, lists.publishSurvey)
        .put(utils.authenticate, lists.processPublishSurvey);

    app.route('/api/lists/pdf')
        .get(utils.authenticate, lists.generatePdf);

    app.route('/api/lists/:listId').all(utils.authenticate)
        .get(lists.read)
        .put(lists.update)
        .delete(lists.delete);

    app.route('/api/lists/:listId/add_contacts')
        .post(utils.authenticate, lists.addContacts);


    // Finish by binding the List middleware
    app.param('listId', lists.listByID);
};
