<commit_before>/**
 * Server configuration
 */

import 'babel-polyfill';
import path from 'path';
import express from 'express';
import bodyParser from 'body-parser';
import React from 'react';
// import ReactDom from 'react-dom/server';
// import schema from './data/models'

import routes from './routes';
import apiRoutes from './apiRoutes';
import {port} from './config';

const app = express();

//
// Register Node.js middleware
// -----------------------------------------------------------------------------
app.use(express.static(path.join(__dirname, 'public')));
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());

//
// Register routes in express
// -----------------------------------------------------------------------------
app.use('/', routes);
app.use('/api', apiRoutes);

//
// Launch the server
// -----------------------------------------------------------------------------
app.listen(port, () => {
    console.log(`The server is running at http://localhost:${port}/`);
});<commit_msg>Putting /api routes before / so that any get routes inside /api endpoints can be reached<commit_after>/**
 * Server configuration
 */

import 'babel-polyfill';
import path from 'path';
import express from 'express';
import bodyParser from 'body-parser';
import React from 'react';
// import ReactDom from 'react-dom/server';
// import schema from './data/models'

import routes from './routes';
import apiRoutes from './apiRoutes';
import {port} from './config';

const app = express();

//
// Register Node.js middleware
// -----------------------------------------------------------------------------
app.use(express.static(path.join(__dirname, 'public')));
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());

//
// Register routes in express
// -----------------------------------------------------------------------------
app.use('/api', apiRoutes);
app.use('/', routes);

//
// Launch the server
// -----------------------------------------------------------------------------
app.listen(port, () => {
    console.log(`The server is running at http://localhost:${port}/`);
});
{'fraction_non_alphanumeric': 0.3465883416177135, 'fraction_numerical': 0.0, 'mean_word_length': 1.5595375722543352, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2826973', 'n_tokens_mistral': 550, 'n_tokens_neox': 554, 'n_words': 154}