File: D:/HostingSpaces/RImmers2/portal.photomenu.nl/wwwroot/release.js
// ===================================================
// IMPORTANT: only for production
// total.js - web application framework for node.js
// http://www.totaljs.com
// ===================================================
var fs = require('fs');
var options = {};
options.ip = process.env.HOST_IP || 'localhost';
options.port = process.env.PORT;
var util = require('util');
const logPath = `${__dirname}/../tmp/log.txt$`;
var logFile = fs.createWriteStream(logPath, { flags: 'a' });
// Or 'w' to truncate the file every time the process starts.
//var logFile = fs.appendFile(logPath);
var logStdout = process.stdout;
console.log = function () {
logFile.write(util.format.apply(null, arguments) + '\n');
logStdout.write(util.format.apply(null, arguments) + '\n');
}
console.error = console.log;
// options.port = parseInt(process.argv[2]);
// options.config = { name: 'total.js' };
// options.https = { key: fs.readFileSync('keys/agent2-key.pem'), cert: fs.readFileSync('keys/agent2-cert.pem')};
// options.sleep = 2000;
/**
* Release notes:
*/
require('total.js').http('release', options);
// require('total.js').https('release', options);