<commit_before>'use strict';

import async from 'async';
import express from 'express';
// import mongoose from 'mongoose';
// import logger from '../helpers/logger';
import {
  loadLocations,
  loadUsers
} from '../helpers/functions';

// load models
// const Location = mongoose.model('Location');

// create router
const router = express.Router();
// load other routes
router.use('/register', require('./register'));
router.use('/yo', require('./yo'));

// main page
router.get('/', (req, res, next) => {
  async.parallel([
    loadLocations,
    loadUsers
  ], (err, results) => (err) ? next(err) : res.render('index', {
    title: 'mapper',
    locations: results[0],
    users: results[1]
  }));
});
// user page
router.get('/users/:user', (req, res, next) => res.render('users', {
  title: `${req.params.user}`,
  data: [{
    lat: 0,
    lng: 0
  }, {
    lat: 1,
    lng: 1
  }, {
    lat: 2,
    lng: 2
  }]
}));
// about page
router.get('/about', (req, res, next) => res.render('about', {
  title: '*about*'
}));

// export router
module.exports = router;

<commit_msg>finished specific user route<commit_after>'use strict';

import async from 'async';
import express from 'express';
import mongoose from 'mongoose';
import {
  loadLocations,
  loadUsers
} from '../helpers/functions';

// load models
const Location = mongoose.model('Location');

// create router
const router = express.Router();
// load other routes
router.use('/register', require('./register'));
router.use('/yo', require('./yo'));

// main page
router.get('/', (req, res, next) =>
  async.parallel([
    loadLocations,
    loadUsers
  ], (err, results) => (err) ? next(err) : res.render('index', {
    title: 'mapper',
    locations: results[0],
    users: results[1]
  }))
);

// user page
router.get('/users/:user', (req, res, next) =>
  Location.find({
    user: req.params.user
  }).sort('-date').exec((err, docs) => res.render('users', {
    title: `${req.params.user}`,
    locations: docs
  }))
);

// about page
router.get('/about', (req, res, next) => res.render('about', {
  title: '*about*'
}));

// export router
module.exports = router;


{'fraction_non_alphanumeric': 0.20852858481724462, 'fraction_numerical': 0.004686035613870665, 'mean_word_length': 3.4665271966527196, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '6173893', 'n_tokens_mistral': 711, 'n_tokens_neox': 710, 'n_words': 183}