changed mongo config stanza.

This commit is contained in:
tenthirtyone 2017-08-02 15:42:34 -04:00
parent 767fc7e98a
commit 6b7496e0c7
2 changed files with 3 additions and 7 deletions

View File

@ -4,11 +4,8 @@ const config = require('./config/config.js');
const logger = require('./lib/logger');
const Block = require('./models/block');
const Server = require('./lib/server');
//const BcoinNode = require('./lib/bcoin');
mongoose.connect(config.mongodb, {
useMongoClient: true
});
mongoose.connect(config.mongodb.uri, config.mongodb.options);
logger.log('debug',
'Debug mode started');
@ -35,6 +32,7 @@ function processBlock(block) {
block.hash = revHex(block.hash().toString('hex'));
logger.log('debug',
`New Block Height: ${block.height}, Hash: ${block.hash}`);
let b = new Block({
mainChain: true,
height: block.height,

View File

@ -4,9 +4,7 @@ const mongoose = require('mongoose');
const config = require('../../config/config.js');
const Block = require('../../models/block.js');
mongoose.connect(config.mongodb, {
useMongoClient: true
});
mongoose.connect(config.mongodb.uri, config.mongodb.options);
app.get('/block/:blockhash', (req, res) => {
res.send(req.params.blockhash);