<commit_before>const express = require('express');
const bodyParser = require('body-parser');

const app = express();
const jsonParser = bodyParser.json();
const HOST = process.env.HOST;
const PORT = process.env.PORT || 8080;

app.use(express.static('build'));
app.use(jsonParser);
app.use((req, res, next) => {
  res.header('Access-Control-Allow-Origin', '*');
  res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
  res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
  next();
});

app.post('/register', (req, res) => {
	const email = req.body.email;
	const password = <PASSWORD>;
    loginAdmin(username, password).then((err, data) => {
        if (err) {
            console.error(err);
            return res.sendStatus(500);
        }
        res.json(data);
	res.json({ message: 'Hello, world!' });
});

app.get('/login', (req, res) => {
	const email = req.body.email;
	const password = <PASSWORD>;
	res.json({ message: 'Hello, world!' });
});

function runServer() {
	app.listen(PORT, HOST, err => {
		if (err) return console.error(err);
		console.log(`Listening on port ${PORT}`);
	});
}

if (require.main === module) runServer();<commit_msg>imports auth functions into server.js and completes endpoints<commit_after>const express = require('express');
const bodyParser = require('body-parser');
const register = require('./server-side/functions/register');
const login = require('./server-side/functions/login');

const app = express();
const jsonParser = bodyParser.json();
const HOST = process.env.HOST;
const PORT = process.env.PORT || 8080;

app.use(express.static('build'));
app.use(jsonParser);
app.use((req, res, next) => {
    res.header('Access-Control-Allow-Origin', '*');
    res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
    res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
    next();
});

app.post('/register', (req, res) => {
    const credentials = req.body;
    register(credentials).then((err, user) => {
        if (err) {
            console.error(err);
            return res.sendStatus(500);
        }
        res.json({ user });
    });
});

app.get('/login', (req, res) => {
    const credentials = req.body;
    login(credentials).then((err, user) => {
        if (err) {
            console.error(err);
            return res.sendStatus(500);
        }
        res.json({ user });
    });
});

function runServer() {
	app.listen(PORT, HOST, err => {
		if (err) return console.error(err);
		console.log(`Listening on port ${PORT}`);
	});
}

if (require.main === module) runServer();
{'fraction_non_alphanumeric': 0.19212007504690432, 'fraction_numerical': 0.006378986866791745, 'mean_word_length': 3.5965517241379312, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '4835710', 'n_tokens_mistral': 870, 'n_tokens_neox': 847, 'n_words': 185}