<commit_before>import compression from 'compression';
import device from 'express-device';
import esteMiddleware from '../lib/esteMiddleware';
import express from 'express';
import path from 'path';
// import favicon from 'serve-favicon';
import render from './render';

const app = express();

app.use(esteMiddleware());
app.use(compression());

// app.use(favicon('assets/img/favicon.ico'));

// the project's root directory for path resolution.
const basePath = path.join(__dirname, '../../..');
const assetsDir = path.join(basePath, 'assets');

// Serve the static assets. We can cache them as they include hashes.
app.use('/assets/img', express.static(path.join(assetsDir, 'img'), {maxAge: '200d'}));
app.use('/_assets', express.static(path.join(basePath, 'build'), {maxAge: '200d'}));

// Intl.
app.use('/node_modules/intl/dist', express.static('node_modules/intl/dist'));
app.use('/node_modules/intl/locale-data', express.static('node_modules/intl/locale-data'));<commit_msg>made assets/img relative to the directory where you launch your node process<commit_after>import compression from 'compression';
import device from 'express-device';
import esteMiddleware from '../lib/esteMiddleware';
import express from 'express';
import path from 'path';
// import favicon from 'serve-favicon';
import render from './render';

const app = express();

app.use(esteMiddleware());
app.use(compression());

// app.use(favicon('assets/img/favicon.ico'));


// Serve the static assets. We can cache them as they include hashes.
// express.static is relative to the directory where you launch your node process
app.use('/assets/img', express.static('assets/img', {maxAge: '200d'}));
app.use('/_assets', express.static('build', {maxAge: '200d'}));

// Intl.
app.use('/node_modules/intl/dist', express.static('node_modules/intl/dist'));
app.use('/node_modules/intl/locale-data', express.static('node_modules/intl/locale-data'));
{'fraction_non_alphanumeric': 0.17239583333333333, 'fraction_numerical': 0.00625, 'mean_word_length': 5.424749163879599, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5873343', 'n_tokens_mistral': 591, 'n_tokens_neox': 579, 'n_words': 156}