<commit_before>var express = require('express');
var bodyParser= require('body-parser')
var app = express();
var MongoClient = require('mongodb').MongoClient;
var db;

app.use(bodyParser.urlencoded({extended: true}))

app.set('port', (process.env.PORT || 5000));

app.use(express.static(__dirname + '/public'));

// views is directory for all template files
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');

app.get('/', function(request, response) {
  response.render('pages/index');
});

app.get('/api/places', function (req, res) {
  console.log('request from client');
  db.collection('places').find().sort({code: 1}).toArray(function (err, data) {
    if (err) {
      res.status(500).json(err);
      return;
    }
    res.json(data);
  });
});

app.put('/api/places/:id', function (req, res) {
  console.log('request from client');
  db.collection('places').find({_id: req.params.id}).toArray(function (err, data) {
    if (err) {
      res.status(500).json(err);
      return;
    }
    res.json(data[0]);
  });
});

MongoClient.connect('mongodb://luisCordoba:<EMAIL>UserForRoadTripV1!<EMAIL>:33251/heroku_m7t659bm', (err, database) => {
  if (err) {
    console.log(err);
    return;<commit_msg>test geolocation<commit_after>var express = require('express');
var bodyParser= require('body-parser')
var app = express();
var MongoClient = require('mongodb').MongoClient;
var db;

app.use(bodyParser.urlencoded({extended: true}))

app.set('port', (process.env.PORT || 5000));

app.use(express.static(__dirname + '/public'));

// views is directory for all template files
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');

app.get('/', function(request, response) {
  response.render('pages/index');
});

app.get('/api/places', function (req, res) {
  db.collection('places').find().sort({code: 1}).toArray(function (err, data) {
    if (err) {
      res.status(500).json(err);
      return;
    }
    res.json(data);
  });
});

app.put('/api/places/:id', function (req, res) {
  db.collection('places').update({_id: req.params.id}, {checked: true});
  res.json({});
});

MongoClient.connect('mongodb://luisCordoba:<EMAIL>UserForRoadTripV1!@<EMAIL>:33251/heroku_m7t659bm', (err, database) => {
  if (err) {
    console.log(err);
    return;
{'fraction_non_alphanumeric': 0.20935314685314685, 'fraction_numerical': 0.017482517482517484, 'mean_word_length': 4.569343065693431, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '2153016', 'n_tokens_mistral': 834, 'n_tokens_neox': 790, 'n_words': 144}