<commit_before>'use strict';

var express = require('express');
var path = require('path');
var util = require('util');
var pg = require('pg');

var createApp = module.exports.app = function(options, client) {
  var app = express();
  app.use(express.static(path.join(__dirname, 'public')));
  app.get('/setup', function(req, res) {
    // create table visits (count int)
    // insert into visits values (0)
  });
  app.get('/increment', function(req, res) {
    client.query('update visits set count = count + 1', function(err, result) {
      if (err) { throw err; }
      client.query('select count from visits limit 1', function(err, result) {
        if (err) { throw err; }
        res.send(util.format('got back err: %s, result: %j', err, result.rows[0].count));
      })
    });
  });
  return app;
};

if (require.main === module) {
  var settings = {
    env: process.env.NODE_ENV || 'development',
    port: process.env.PORT || 3000,
    dbURL: process.env.DATABASE_URL ||<commit_msg>JSON.<commit_after>'use strict';

var express = require('express');
var path = require('path');
var util = require('util');
var pg = require('pg');

var createApp = module.exports.app = function(options, client) {
  var app = express();
  app.use(express.static(path.join(__dirname, 'public')));
  app.get('/setup', function(req, res) {
    // create table visits (count int)
    // insert into visits values (0)
  });
  app.get('/increment', function(req, res) {
    client.query('update visits set count = count + 1', function(err, result) {
      if (err) { throw err; }
      client.query('select count from visits limit 1', function(err, result) {
        if (err) { throw err; }
        res.json({ visits: result.rows[0].count });
      })
    });
  });
  return app;
};

if (require.main === module) {
  var settings = {
    env: process.env.NODE_ENV || 'development',
    port: process.env.PORT || 3000,
    dbURL: process.env.DATABASE_URL ||
{'fraction_non_alphanumeric': 0.17574511819116137, 'fraction_numerical': 0.008221993833504625, 'mean_word_length': 3.3557046979865772, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1900104', 'n_tokens_mistral': 629, 'n_tokens_neox': 614, 'n_words': 169}