diff --git a/app/controllers/blocks.js b/app/controllers/blocks.js index 5dfa632..5381ec0 100644 --- a/app/controllers/blocks.js +++ b/app/controllers/blocks.js @@ -29,21 +29,6 @@ exports.show = function(req, res) { res.jsonp(req.block); }; -/** - * List of blocks at HomePage - */ -exports.last_blocks = function(req, res) { - Block.find().sort({time:-1}).limit(7).exec(function(err, blocks) { - if (err) { - res.render('error', { - status: 500 - }); - } else { - res.jsonp(blocks); - } - }); -}; - /** * List of blocks by date */ diff --git a/config/routes.js b/config/routes.js index f24ac7d..83c7eb3 100644 --- a/config/routes.js +++ b/config/routes.js @@ -14,8 +14,6 @@ module.exports = function(app) { app.get('/api/block/:blockHash', blocks.show); app.param('blockHash', blocks.block); - app.get('/last_blocks', blocks.last_blocks); - var transactions = require('../app/controllers/transactions'); app.get('/api/tx/:txid', transactions.show); diff --git a/public/js/controllers/index.js b/public/js/controllers/index.js index bec0f0a..6043526 100755 --- a/public/js/controllers/index.js +++ b/public/js/controllers/index.js @@ -2,9 +2,5 @@ angular.module('mystery.system').controller('IndexController', ['$scope', 'Global', 'Index', function ($scope, Global, Index) { $scope.global = Global; - $scope.last_blocks = function() { - Index.query(function(blocks) { - $scope.blocks = blocks; - }); - }; + $scope.index = Index; }]); diff --git a/public/js/services/index.js b/public/js/services/index.js index f961642..08cb3ff 100644 --- a/public/js/services/index.js +++ b/public/js/services/index.js @@ -1,5 +1,5 @@ 'use strict'; angular.module('mystery.index').factory('Index', ['$resource', function($resource) { - return $resource('/last_blocks'); + return $resource; }]); diff --git a/public/views/index.html b/public/views/index.html index 97d4c36..469172a 100644 --- a/public/views/index.html +++ b/public/views/index.html @@ -1,17 +1,8 @@
-
+