<commit_before>/*
 * RESTfull API: Dashboard Resources
 * 
 * 
 */


var passport = require('passport')
  , mongoose = require('mongoose')
  , _ = require('underscore')
  , config = require('../../../config.json');

var Project = mongoose.model('Project')
  , User = mongoose.model('User')
  , Dashboard = mongoose.model('Dashboard');

module.exports = function(app, uri, common) {

  app.post(uri + '/dashboards', common.isAuth, validateSubdomain, createDashboard(app), sendDashboard);
  app.get(uri + '/dashboards', setQuery, setDashboards, sendDashboards);
  
  app.get(uri + '/dashboards/:domain', getDashboard, sendDashboard);
  app.get(uri + '/', getDashboard, sendDashboard);

  app.put(uri + '/', common.isAuth, getDashboard, isAdminDashboard, updateDashboard, sendDashboard);

  app.post(uri + '/', common.notAllowed);
  app.del(uri + '/', common.notAllowed);

  app.get(uri + '/csv', common.isAuth, getDashboard, isAdminDashboard, sendDashboardCSV);
};
<commit_msg>added new route for dashboards. #111<commit_after>/*
 * RESTfull API: Dashboard Resources
 * 
 * 
 */


var passport = require('passport')
  , mongoose = require('mongoose')
  , _ = require('underscore')
  , config = require('../../../config.json');

var Project = mongoose.model('Project')
  , User = mongoose.model('User')
  , Dashboard = mongoose.model('Dashboard');

module.exports = function(app, uri, common) {

  app.post(uri + '/dashboards', common.isAuth, validateSubdomain, createDashboard(app), sendDashboard);
  app.get(uri + '/dashboards', setQuery, setDashboards, sendDashboards);
  
  app.get(uri + '/dashboards/:domain', getDashboard, sendDashboard);
  app.get(uri + '/', getDashboard, sendDashboard);

  app.put(uri + '/dashboards/:domain', common.isAuth, getDashboard, isAdminDashboard, updateDashboard, sendDashboard);
  app.put(uri + '/', common.isAuth, getDashboard, isAdminDashboard, updateDashboard, sendDashboard);

  app.post(uri + '/', common.notAllowed);
  app.del(uri + '/', common.notAllowed);

  app.get(uri + '/csv', common.isAuth, getDashboard, isAdminDashboard, sendDashboardCSV);
};

{'fraction_non_alphanumeric': 0.1711281070745698, 'fraction_numerical': 0.0014340344168260039, 'mean_word_length': 4.765840220385675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2943561', 'n_tokens_mistral': 697, 'n_tokens_neox': 723, 'n_words': 128}