<commit_before>var express = require('express');
var bodyParser = require('body-parser');
var redis = require('redis');

var redisURL = process.env.REDIS_URL;
var client = redis.createClient(redisURL);

var app = express();
app.set('port', (process.env.PORT || 3000));
app.use(bodyParser.json());
app.use(express.static('public'));

app.get('/api/dog/:id', function(req, res) {
  res.json({ id: req.params.id });
});

app.put('/api/dog/:id', function(req, res) {
  res.json({ id: req.params.id });<commit_msg>redirect to https on prod<commit_after>var env = process.env.NODE_ENV || 'development';
var express = require('express');
var bodyParser = require('body-parser');
var redis = require('redis');

var redisURL = process.env.REDIS_URL;
var client = redis.createClient(redisURL);

var app = express();
app.set('port', (process.env.PORT || 3000));
app.use(bodyParser.json());
app.use(express.static('public'));

var forceSsl = function (req, res, next) {
  if (req.headers['x-forwarded-proto'] !== 'https') {
    return res.redirect(['https://', req.get('Host'), req.url].join(''));
  }
  return next();
};

if (env === 'production') {
  app.use(forceSsl);
}

app.get('/api/dog/:id', function(req, res) {
  res.json({ id: req.params.id });
});

app.put('/api/dog/:id', function(req, res) {
  res.json({ id: req.params.id });
{'fraction_non_alphanumeric': 0.2215523737754333, 'fraction_numerical': 0.006028636021100226, 'mean_word_length': 4.955156950672646, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '1711373', 'n_tokens_mistral': 476, 'n_tokens_neox': 470, 'n_words': 97}