<commit_before>import Hapi from 'hapi';

import config from './config/config';

import sendEmail from './utils/sendEmail';

const data = {
    GMAIL_USER: process.env.GMAIL_USER,
    GMAIL_PASS: process.env.GMAIL_PASS
}

// Create a server with a host and port
const server = new Hapi.Server();

server.connection({ 
    host: 'localhost', 
    port: process.env.PORT || 8000,
    routes : {
        cors : true
    }
});

// Add the route
server.route({
    method: 'GET',
    path:'/', 
    handler: (request, reply)=> reply("Working!")
});

// Add the route
server.route({
    method: 'POST',
    path:'/send-email', 
    handler: (request, reply)=> {

        sendEmail(request.payload, data )
        .then((data)=> reply({ message: "Send Success", data }))
        .catch((error) => reply('Error to sent!'))
        
    }
});


// Start the server
server.start((err) => {
    if (err) throw err;
    console.log('Server running at:', server.info.uri);<commit_msg>deploy<commit_after>import Hapi from 'hapi';

import config from './config/config';

import sendEmail from './utils/sendEmail';

const data = {
    GMAIL_USER: process.env.GMAIL_USER,
    GMAIL_PASS: process.env.GMAIL_PASS
}

// Create a server with a host and port
const server = new Hapi.Server();

server.connection({ 
    host: (process.env.DEV) ? 'localhost' : '0.0.0.0', 
    port: process.env.PORT || 8000,
    routes : {
        cors : true
    }
});

// Add the route
server.route({
    method: 'GET',
    path:'/', 
    handler: (request, reply)=> reply("Working!")
});

// Add the route
server.route({
    method: 'POST',
    path:'/send-email', 
    handler: (request, reply)=> {

        sendEmail(request.payload, data )
        .then((data)=> reply({ message: "Send Success", data }))
        .catch((error) => reply('Error to sent!'))
        
    }
});


// Start the server
server.start((err) => {
    if (err) throw err;
    console.log('Server running at:', server.info.uri);
{'fraction_non_alphanumeric': 0.17048346055979643, 'fraction_numerical': 0.0061068702290076335, 'mean_word_length': 2.7807692307692307, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '4959191', 'n_tokens_mistral': 664, 'n_tokens_neox': 650, 'n_words': 169}