<commit_before>'use strict';

const superagent = require('superagent');
require('dotenv').config();
const pg = require('pg');
const express = require('express');

const PORT = process.env.PORT || 3000;
const app = express();

const conString = 'postgres://merylturner@localhost:5432/magenta';
const client = new pg.Client(conString);
client.connect();
client.on('error', err => console.error(err));

app.use(express.static('./public'));

app.get('/game', (request, response) => response.sendFile('index.html', { root: './public' }));
app.get('/about', (request, response) => response.sendFile('index.html', { root: './public' }));

loadDB();

var sourcesArray = ['the-new-york-times', 'the-huffington-post', 'usa-today', 'daily-mail', 'breitbart-news'];

sourcesArray.forEach((source) => {
    app.get(`/${source}`, (request, response) => {
        superagent
			.get(`https://newsapi.org/v1/articles?source=${source}&sortBy=top&apiKey=${process.env.API_KEY}`)
			.end((err, superagentResponse) => response.send(superagentResponse.text));
    });
});
<commit_msg>constring changed to database url<commit_after>'use strict';

const superagent = require('superagent');
require('dotenv').config();
const pg = require('pg');
const express = require('express');

const PORT = process.env.PORT || 3000;
const app = express();

const conString = process.env.DATABASE_URL;
const client = new pg.Client(conString);
client.connect();
client.on('error', err => console.error(err));

app.use(express.static('./public'));

app.get('/game', (request, response) => response.sendFile('index.html', { root: './public' }));
app.get('/about', (request, response) => response.sendFile('index.html', { root: './public' }));

loadDB();

var sourcesArray = ['the-new-york-times', 'the-huffington-post', 'usa-today', 'daily-mail', 'breitbart-news'];

sourcesArray.forEach((source) => {
    app.get(`/${source}`, (request, response) => {
        superagent
			.get(`https://newsapi.org/v1/articles?source=${source}&sortBy=top&apiKey=${process.env.API_KEY}`)
			.end((err, superagentResponse) => response.send(superagentResponse.text));
    });
});

{'fraction_non_alphanumeric': 0.2166745171926519, 'fraction_numerical': 0.00659444182760245, 'mean_word_length': 5.515337423312883, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '4243268', 'n_tokens_mistral': 697, 'n_tokens_neox': 677, 'n_words': 124}