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

View File

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