appfog heroku

This commit is contained in:
theory 2014-04-01 03:05:23 -06:00
parent ebffba676f
commit 85884961e5

View File

@ -5,10 +5,7 @@ var LIVE = process.env.LIVE || (process.env.NODE_ENV === 'production')
, web = require('coalesce')
, opt = {};
opt.port = process.env.PORT || process.env.OPENSHIFT_NODEJS_POR || process.env.VCAP_APP_PORT || 8888;
process.env.domain = LIVE? 'http://gunjs.herokuapp.com' :
(function(){require('child_process').exec('ifconfig',function(e,r){
console.log('on',process.env.domain='http://'+ r.match(/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/)[0] +':'+opt.port)
})})();
opt.hook = {
pre: (function(req,res){
//console.log("--------- "+req.flow+" : "+req.url.pathname +" ---------------");