changed mongo config stanza.
This commit is contained in:
parent
767fc7e98a
commit
6b7496e0c7
6
index.js
6
index.js
@ -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,
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user