<commit_before>import express from 'express'
import path from 'path'

const app = express()

// Figure out what scripts we need to load
let scriptPaths

if (process.env.NODE_ENV === 'production') {
  const sources = ['manifest.js', 'vendor.js', 'bundle.js']
  const manifest = require('./public/manifest.json')
  scriptPaths = sources
    .map(source => `/public/${manifest[source]}`)
} else {
  const webpack = require('webpack')
  const config = require('../../webpack.config.dev')
  const compiler = webpack(config)

  app.use(require('webpack-dev-middleware')(compiler))
  scriptPaths = ['bundle.js']
}

// Set up Handlebars to serve our index template
app.set('views', path.resolve(__dirname, 'views'))
app.set('view engine', 'hbs')

// Serve static webpack assets in production
app.use('/public', express.static(path.resolve(__dirname, 'public')))

app.get('*', (req, res) => {
  res.render('index', { scriptPaths })
})

app.listen(3000, () => {
  console.log('Universal React App listening on http://localhost:3000')
})
<commit_msg>basic express server<commit_after>import express from 'express'
import path from 'path'

const app = express()

// The JS files we should embed in our template
let scriptPaths

if (process.env.NODE_ENV === 'production') {
  const sources = ['manifest.js', 'vendor.js', 'bundle.js']
  const manifest = require('./public/manifest.json')
  scriptPaths = sources
    .map(source => `/${manifest[source]}`)
} else {
  const webpack = require('webpack')
  const config = require('../../webpack.config.dev')
  const compiler = webpack(config)

  app.use(require('webpack-dev-middleware')(compiler))
  scriptPaths = ['/bundle.js']
}

// Set up Handlebars to serve our index template
app.set('views', path.resolve(__dirname, 'views'))
app.set('view engine', 'hbs')

// Serve static webpack assets in production
app.use('/', express.static(path.resolve(__dirname, 'public')))

app.get('*', (req, res) => {
  res.render('index', { scriptPaths })
})

app.listen(3000, () => {
  console.log('Universal React App listening on http://localhost:3000')
})

{'fraction_non_alphanumeric': 0.1751684311838306, 'fraction_numerical': 0.007699711260827719, 'mean_word_length': 4.5588235294117645, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3353502', 'n_tokens_mistral': 652, 'n_tokens_neox': 629, 'n_words': 171}