process.env.TMPDIR ='tmp' ;
//process.env ['NODE_TLS_REJECT_UNAUTHORIZED'] ='0' ; // Ignore 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' authorization error

var app =require ('./server/server') ;

var server =app.listen (app.get ('port'), function () {
    console.log ('API key ' + process.env.FORGE_CLIENT_ID) ;
    console.log ('Server listening on port ' + server.address ().port) ;
}) ;

server.on ('error', function (err) {
	if ( err.errno == 'EACCES' ) {
		console.log ('Port ' + app.get ('port') + ' already in use.\nExiting...') ;
		process.exit (1) ;
	}
}) ;
