turn controllers into namespaces

This commit is contained in:
Manuel Araoz 2015-03-05 17:06:15 -03:00
parent d5781a4bc5
commit 125d7b22f8
2 changed files with 4 additions and 4 deletions

View File

@ -9,7 +9,7 @@ var Block = bitcore.Block;
var mockBlocks = require('../test/data/blocks'); var mockBlocks = require('../test/data/blocks');
function Blocks() {} var Blocks = {};
var node; var node;
Blocks.setNode = function(aNode) { Blocks.setNode = function(aNode) {
@ -21,7 +21,7 @@ Blocks.setNode = function(aNode) {
Blocks.blockHashParam = function(req, res, next, blockHash) { Blocks.blockHashParam = function(req, res, next, blockHash) {
// TODO: fetch block from service // TODO: fetch block from service
var block = mockBlocks[blockHash]; var block = mockBlocks[blockHash];
if (_.isUndefined(block)) { if (_.isUndefined(block)) {
res.status(404).send('Block with id ' + blockHash + ' not found'); res.status(404).send('Block with id ' + blockHash + ' not found');
return; return;
@ -34,7 +34,7 @@ Blocks.heightParam = function(req, res, next, height) {
// TODO: fetch block from service // TODO: fetch block from service
height = parseInt(height); height = parseInt(height);
var block = mockBlocks[Object.keys(mockBlocks)[height]]; var block = mockBlocks[Object.keys(mockBlocks)[height]];
if (_.isUndefined(block)) { if (_.isUndefined(block)) {
res.status(404).send('Block with height ' + height + ' not found'); res.status(404).send('Block with height ' + height + ' not found');
return; return;

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
function NodeStatus() {} var NodeStatus = {};
var node; var node;
NodeStatus.setNode = function(aNode) { NodeStatus.setNode = function(aNode) {
node = aNode; node = aNode;