Remove console logs. Fix cors

This commit is contained in:
tenthirtyone 2017-08-10 21:35:55 -04:00
parent 68af224331
commit 4a0138b666
7 changed files with 18 additions and 17 deletions

View File

@ -33,3 +33,9 @@ Ctrl+D out of mongo
rm -rf ${bcoin-prefix-in-config.js}/chain.ldb rm -rf ${bcoin-prefix-in-config.js}/chain.ldb
``` ```
### Contributing
1. Fork
2. Branch
3. Send a PR

View File

@ -1,4 +1,9 @@
module.exports = function addressrouter(router) { const Block = require('../../models/block.js');
const logger = require('../logger');
const MAX_BLOCKS = 200;
module.exports = function AddressAPI(router) {
router.get('/addr/:addr', (req, res) => { router.get('/addr/:addr', (req, res) => {
res.send(req.params.addr); res.send(req.params.addr);
}); });

View File

@ -3,9 +3,9 @@ const config = require('../../config');
const app = express(); const app = express();
const api = express.Router(); const api = express.Router();
const CORS = require('./CORS'); const cors = require('./cors');
app.use(CORS); app.use(cors);
// Serve insight ui front end from root dir public folder // Serve insight ui front end from root dir public folder
app.use('/', express.static('./public')); app.use('/', express.static('./public'));

View File

@ -1,23 +1,15 @@
module.exports = function addressrouter(io) { module.exports = function addressrouter(io) {
io.on('connection', (socket) => { io.on('connection', (socket) => {
socket.on('subscribe', (data) => { socket.on('subscribe', (data) => {
console.log('subscribe message');
console.log(data);
}); });
socket.on('message', (data) => { socket.on('message', (data) => {
console.log('unsubscribe message');
console.log(data);
}); });
socket.on('unsubscribe', (data) => { socket.on('unsubscribe', (data) => {
console.log('unsubscribe message');
console.log(data);
}); });
socket.on('disconnect', (data) => { socket.on('disconnect', (data) => {
console.log('unsubscribe message');
console.log(data);
}); });
}); });
}; };

View File

@ -39,7 +39,7 @@ function start() {
}); });
node.pool.on('peer', (peer) => { node.pool.on('peer', (peer) => {
// console.log(peer);
}); });
node.on('error', (err) => { node.on('error', (err) => {
@ -48,7 +48,7 @@ function start() {
}); });
node.mempool.on('tx', (tx) => { node.mempool.on('tx', (tx) => {
console.log(tx)
}); });
} }

View File

@ -11,7 +11,7 @@ function parse(entry, txs) {
tx.outputs.forEach((output) => { tx.outputs.forEach((output) => {
const outputJSON = output.toJSON(); const outputJSON = output.toJSON();
//console.log(outputJSON);
/* /*
return new OutputModel({ return new OutputModel({
address: outputJSON.address, address: outputJSON.address,
@ -22,7 +22,7 @@ function parse(entry, txs) {
tx.inputs.forEach((input) => { tx.inputs.forEach((input) => {
const inputJSON = input.toJSON(); const inputJSON = input.toJSON();
//console.log(inputJSON);
/* return new InputModel({ /* return new InputModel({
prevout: inputJSON.prevout, prevout: inputJSON.prevout,
script: inputJSON.script, script: inputJSON.script,

View File

@ -24,8 +24,6 @@ function parse(entry, txs) {
const valB = (tx.value || tx.valueOut.value || 0) / 1e8; const valB = (tx.value || tx.valueOut.value || 0) / 1e8;
console.log(valB)
return sum + valB; return sum + valB;
}, 0), }, 0),
}); });