<commit_before>import express from 'express';
import dotenv from 'dotenv';
import log from './log';
import requestLogger from './log/request-logger';
import userRoutes from './routes/users';
import postRoutes from './routes/posts';

dotenv.config();

const app = express();
app.use(requestLogger);

app.use('/users', userRoutes);
app.use('/posts', postRoutes);

const port = process.env.CSBLOGS_API_PORT;

app.listen(port, () => {
  log.info({ port }, 'CSBlogs API now running');
});
<commit_msg>Added database syndication code (must be ran before using models to ensure database exists)<commit_after>import express from 'express';
import database from './database';
import log from './log';
import requestLogger from './log/request-logger';
import userRoutes from './routes/users';
import postRoutes from './routes/posts';

database.sync()
  .then(() => {
    const app = express();
    app.use(requestLogger);

    app.use('/users', userRoutes);
    app.use('/posts', postRoutes);

    const port = process.env.CSBLOGS_API_PORT;

    app.listen(port, () => {
      log.info({ port }, 'CSBlogs API now running');
    });
  });

{'fraction_non_alphanumeric': 0.1622340425531915, 'fraction_numerical': 0.0, 'mean_word_length': 4.275700934579439, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '1819929', 'n_tokens_mistral': 344, 'n_tokens_neox': 343, 'n_words': 100}