diff --git a/app/controllers/status.js b/app/controllers/status.js index 7fbc189..47b1f45 100644 --- a/app/controllers/status.js +++ b/app/controllers/status.js @@ -5,12 +5,11 @@ */ var Status = require('../models/Status'); -var async = require('async'); /** * Status */ -exports.show = function(req, res) { +exports.show = function(req, res, next) { if (! req.query.q) { res.status(400).send('Bad Request'); @@ -19,25 +18,25 @@ exports.show = function(req, res) { var s = req.query.q; var d = Status.new(); - if (s == 'getInfo') { + if (s === 'getInfo') { d.getInfo(function(err) { if (err) next(err); res.jsonp(d); }); } - else if (s == 'getDifficulty') { + else if (s === 'getDifficulty') { d.getDifficulty(function(err) { if (err) next(err); res.jsonp(d); }); } - else if (s == 'getTxOutSetInfo') { + else if (s === 'getTxOutSetInfo') { d.getTxOutSetInfo(function(err) { if (err) next(err); res.jsonp(d); }); } - else if (s == 'getBestBlockHash') { + else if (s === 'getBestBlockHash') { d.getBestBlockHash(function(err) { if (err) next(err); res.jsonp(d); diff --git a/public/js/app.js b/public/js/app.js index 452ca7c..5f236b9 100755 --- a/public/js/app.js +++ b/public/js/app.js @@ -1,6 +1,6 @@ 'use strict'; -var app = angular.module('mystery', +angular.module('mystery', ['ngAnimate', 'ngCookies', 'ngResource', diff --git a/public/js/controllers/status.js b/public/js/controllers/status.js index b37a5ae..cc02da9 100644 --- a/public/js/controllers/status.js +++ b/public/js/controllers/status.js @@ -7,16 +7,16 @@ angular.module('mystery.status').controller('StatusController', ['$scope', '$rou Status.get({ q: q }, function(d) { - if (q == 'getInfo') { + if (q === 'getInfo') { $scope.info = d.info; } - if (q == 'getDifficulty') { + if (q === 'getDifficulty') { $scope.difficulty = d.difficulty; } - if (q == 'getTxOutSetInfo') { + if (q === 'getTxOutSetInfo') { $scope.txoutsetinfo = d.txoutsetinfo; } - if (q == 'getBestBlockHash') { + if (q === 'getBestBlockHash') { $scope.bestblockhash = d.bestblockhash; } });