'use strict';
/*global global, require, process, module, baejs*/
/*jslint node: true */

var monk = require('monk');
var db;
var url;
if(process.env.SERVER_SOFTWARE==="bae/3.0"){
    url = "xPOla3Kq34SikGXnVWGUFNjj:UIZ1RYdBSiauTePP8gzoxYp9YjoQGumn@mongo.duapp.com:8908/urAFiIKlkjhtaLrPNvit";
    console.log(url +' mongodb is init');
    db = monk(url);
}else{
    url = 'mywin.int/spider';
    console.log(url +' mongodb is init');
    db = monk(url);
}
var collections = {};
collections.haha = db.get("sp_haha");
collections.youmin = db.get("sp_youmin");
collections.spider = db.get("spider");
collections.HahaJoke = db.get("HahaJoke");



module.exports.db = db;
module.exports.cns = collections;
module.exports.url = url;



'use strict';
/*global global, require, process, module, baejs*/
/*jslint node: true */

var monk = require('monk');
var os = require('os');
var db;
var url;
if (process.env.SERVER_SOFTWARE === "bae/3.0") {
    url = "xPOla3Kq34SikGXnVWGUFNjj:UIZ1RYdBSiauTePP8gzoxYp9YjoQGumn@mongo.duapp.com:8908/urAFiIKlkjhtaLrPNvit";
} else if (os.platform()==='linux' && os.hostname()=='jsonsong' ) {
    url = '127.0.0.1/spider';
}else{
    url = 'mywin.int/spider';
}
db = monk(url);
console.log(url + ' mongodb is init');
var collections = {};
collections.haha = db.get("sp_haha");
collections.youmin = db.get("sp_youmin");
collections.spider = db.get("spider");
collections.HahaJoke = db.get("HahaJoke");


module.exports.db = db;
module.exports.cns = collections;
module.exports.url = url;



add ar db