diff --git a/app/views/includes/foot.jade b/app/views/includes/foot.jade index f25748a2..c7f58073 100755 --- a/app/views/includes/foot.jade +++ b/app/views/includes/foot.jade @@ -1,7 +1,5 @@ #footer(data-ng-include="'/views/footer.html'", role='navigation') -//script(type='text/javascript', src='/lib/jquery/jquery.min.js') -//script(type='text/javascript', src='/lib/bootstrap/dist/js/bootstrap.min.js') script(type='text/javascript', src='/socket.io/socket.io.js') script(type='text/javascript', src='/lib/momentjs/moment.js') script(type='text/javascript', src='/lib/qrcode-generator/js/qrcode.js') diff --git a/config/express.js b/config/express.js index 7ac2645b..692b322e 100644 --- a/config/express.js +++ b/config/express.js @@ -49,12 +49,14 @@ module.exports = function(app, historicSync) { //dynamic helpers app.use(helpers(config.app.name)); + // IMPORTAMT: for html5mode, this line must to be before app.router + app.use(express.static(config.root + '/public')); + //routes should be at the last app.use(app.router); //Setting the fav icon and static folder app.use(express.favicon()); - app.use(express.static(config.root + '/public')); //Assume "not found" in the error msgs is a 404. this is somewhat silly, but valid, you can do whatever you like, set properties, use instanceof etc. app.use(function(err, req, res, next) { diff --git a/config/routes.js b/config/routes.js index 4a134a2c..81189fef 100644 --- a/config/routes.js +++ b/config/routes.js @@ -2,20 +2,6 @@ module.exports = function(app, historicSync) { - //Home route - var index = require('../app/controllers/index'); - - app.get('/', index.render); - app.get('/blocks', index.render); - app.get('/status', index.render); - app.get('/blocks-date/*', index.render); - app.get('/block-index/*', index.render); - app.get('/block/*', index.render); - app.get('/tx/*', index.render); - app.get('/address/*', index.render); - - app.get('/api/version', index.version); - //Block routes var blocks = require('../app/controllers/blocks'); app.get('/api/blocks', blocks.list); @@ -44,4 +30,8 @@ module.exports = function(app, historicSync) { app.get('/api/sync', st.sync); + //Home route + var index = require('../app/controllers/index'); + app.get('/api/version', index.version); + app.get('*', index.render); }; diff --git a/public/js/directives.js b/public/js/directives.js index 9dcaffa2..3bd91db1 100755 --- a/public/js/directives.js +++ b/public/js/directives.js @@ -50,7 +50,6 @@ angular.module('insight') scope.$on('$destroy', function() { client.off('mousedown', onMousedown); - client.unglue(elm); }); }); }