<commit_before>const express = require('express');
// const https = require('https');
// const fs = require('fs');
// const HTTPS_PORT = 3443;
const app = express();
// const secureServer = https.createServer({
//   key: fs.readFileSync('https-keys/private.key'),
//   cert: fs.readFileSync('https-keys/certificate.pem')
// }, app)
// .listen(HTTPS_PORT, function () {
//   console.log('Secure Server listening on port ' + HTTPS_PORT);
// });

require('dotenv').config();
const path = require('path');
const cors = require('express-cors')
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const knex = require('./knex');
const bcrypt = require ('bcrypt');
const saltRounds = 10;
// const jwt = require('jsonwebtoken');
const passport = require('./routes/passport.js')
app.use(cors({
  allowedOrigins: ["localhost:*", "serene-green.herokuapp.com", "fitbit.com"]
}));

// app.all('*', function(req, res, next){
//   if (req.secure) {
//     return next();
//   };
//   res.redirect(`https://${req.hostname}:${HTTPS_PORT}${req.url}`);
// });
app.use('/auth/fitbit', passport);
app.use(cookieParser());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.static(path.join(__dirname, 'client/build')));

app.get('/places', (req, res, next)=>{
  knex('places')<commit_msg>add photos join to places route<commit_after>const express = require('express');
// const https = require('https');
// const fs = require('fs');
// const HTTPS_PORT = 3443;
const app = express();
// const secureServer = https.createServer({
//   key: fs.readFileSync('https-keys/private.key'),
//   cert: fs.readFileSync('https-keys/certificate.pem')
// }, app)
// .listen(HTTPS_PORT, function () {
//   console.log('Secure Server listening on port ' + HTTPS_PORT);
// });

require('dotenv').config();
const path = require('path');
const cors = require('express-cors')
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const knex = require('./knex');
const bcrypt = require ('bcrypt');
const saltRounds = 10;
// const jwt = require('jsonwebtoken');
const passport = require('./routes/passport.js')
app.use(cors({
  allowedOrigins: ["localhost:*", "serene-green.herokuapp.com", "fitbit.com"]
}));

// app.all('*', function(req, res, next){
//   if (req.secure) {
//     return next();
//   };
//   res.redirect(`https://${req.hostname}:${HTTPS_PORT}${req.url}`);
// });
app.use('/auth/fitbit', passport);
app.use(cookieParser());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.static(path.join(__dirname, 'client/build')));

app.get('/places', (req, res, next)=>{
  knex('places')
  .join('photos', 'places.id', 'photos.place_id')
{'fraction_non_alphanumeric': 0.22145953757225434, 'fraction_numerical': 0.004335260115606936, 'mean_word_length': 4.744813278008299, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '2292991', 'n_tokens_mistral': 932, 'n_tokens_neox': 916, 'n_words': 183}