global.__basePath = process.cwd() + '/';
const app = require(__basePath + 'app/app.js');
//const port = process.env.NODE_PORT;

const httpsPort = process.env.NODE_PORT;

const http = require('http');
const https = require('https');
const fs = require('fs');

/**
 * @description Listen Server at configured port
 * @event App Listener
 */
app.listen(httpsPort, function () {
    console.log(`Listening port ${httpsPort}`);
});

// var options = {
//     key: fs.readFileSync('./doolally.key'),
//     cert: fs.readFileSync('./doolally.crt'),
//     ca: fs.readFileSync('./doolally.ca-bundle'),
//     requestCert: false,
//     rejectUnauthorized: false
// };

// https.createServer(options, app).listen(httpsPort, function () {
//     console.log(`Listening port ${httpsPort}`);
// });