#!/usr/bin/env node
var prerender = require('./lib');

var server = prerender({
    workers: process.env.PHANTOM_CLUSTER_NUM_WORKERS,
    iterations: process.env.PHANTOM_WORKER_ITERATIONS || 10,
    phantomBasePort: process.env.PHANTOM_CLUSTER_BASE_PORT || 12300,
    messageTimeout: process.env.PHANTOM_CLUSTER_MESSAGE_TIMEOUT
});

server.use(prerender.removeScriptTags());
server.use(prerender.httpHeaders());

if(process.env.ENV_VARIABLE === 'ENABLE_BASIC_AUTH'){
    server.use(prerender.basicAuth());
}

if(process.env.ENV_VARIABLE === 'ENABLE_WHITELIST'){
    server.use(prerender.whitelist());
}

if(process.env.ENV_VARIABLE === 'ENABLE_BLACKLIST'){
    server.use(prerender.blacklist());
}

if(process.env.ENV_VARIABLE === 'ENABLE_LOGGER'){
    server.use(prerender.logger());
}

if(process.env.ENV_VARIABLE === 'ENABLE_INMEMORYHTMLCACHE'){
    server.use(prerender.inMemoryHtmlCache());
}

if(process.env.ENV_VARIABLE === 'ENABLE_S3HTMLCACHE'){
    server.use(prerender.s3HtmlCache());
}

server.start();

@@ -421,34 +421,16 @@
 ess.env.
-ENV_VARIABLE === '
 ENABLE_B
@@ -438,16 +438,26 @@
 SIC_AUTH
+ === 'true
 ')%7B%0A    
@@ -509,34 +509,16 @@
 ess.env.
-ENV_VARIABLE === '
 ENABLE_W
@@ -521,24 +521,34 @@
 LE_WHITELIST
+ === 'true
 ')%7B%0A    serv
@@ -596,34 +596,16 @@
 ess.env.
-ENV_VARIABLE === '
 ENABLE_B
@@ -612,16 +612,26 @@
 LACKLIST
+ === 'true
 ')%7B%0A    
@@ -683,34 +683,16 @@
 ess.env.
-ENV_VARIABLE === '
 ENABLE_L
@@ -696,16 +696,26 @@
 E_LOGGER
+ === 'true
 ')%7B%0A    
@@ -764,34 +764,16 @@
 ess.env.
-ENV_VARIABLE === '
 ENABLE_I
@@ -780,32 +780,42 @@
 NMEMORYHTMLCACHE
+ === 'true
 ')%7B%0A    server.u
@@ -871,26 +871,8 @@
 env.
-ENV_VARIABLE === '
 ENAB
@@ -885,16 +885,26 @@
 TMLCACHE
+ === 'true
 ')%7B%0A    

fix check variable env