var pack = require('../package.json');

module.exports = function(conf) {

    var base;

    var version = 'w'+pack.version + '_' + 'v'+pack.dependencies['gardr-validator'] + 'h'+pack.dependencies['gardr-host'];


    if (conf.get('env') === 'production'){

        base = 'http://ads-gardr.gardr.org';


        return {
            parentUrl: base+'/preview/parent.html?g='+version,
            iframeUrl: base+'/preview/built/iframe.html?g='+version,
            resourceDomainBase: base,
        };
    }

    base = 'http://127.0.0.1:'+conf.get('port');
    return {
        parentUrl: base+'/preview/parent.html?ts='+Date.now()+'&g='+version,
        iframeUrl: base+'/preview/built/iframe.html?ts='+Date.now()+'&g='+version,
        resourceDomainBase: base
    };

}

@@ -504,16 +504,175 @@
 %0A    %7D%0A%0A
+    if (process.env.HOST_BASE) %7B%0A        var port = conf.get('port');%0A        base = process.env.HOST_BASE + (port !== 80 ? ':' + port : '');%0A    %7D else %7B%0A    
     base
@@ -708,24 +708,32 @@
 et('port');%0A
+    %7D%0A%0A%0A
     return %7B

improve base variable resultion