diff --git a/config/express.js b/config/express.js index 9d4195d..32cfaa5 100644 --- a/config/express.js +++ b/config/express.js @@ -4,19 +4,23 @@ * Module dependencies. */ var express = require('express'), - config = require('./config'); + helpers = require('view-helpers'), + config = require('./config') + path = require('path'); module.exports = function(app, historicSync, peerSync) { - //custom middleware - function setHistoric(req, res, next) { + + //custom middleware + var setHistoric = function(req, res, next) { req.historicSync = historicSync; next(); - } - function setPeer(req, res, next) { + }; + + var setPeer = function(req, res, next) { req.peerSync = peerSync; next(); - } + }; app.set('showStackError', true); @@ -34,6 +38,13 @@ module.exports = function(app, historicSync, peerSync) { app.use(express.methodOverride()); app.use(express.compress()); + if (process.env.INSIGHT_PUBLIC_PATH) { + var staticPath = path.normalize(config.rootPath + '/../../' + process.env.INSIGHT_PUBLIC_PATH); + + //IMPORTANT: for html5mode, this line must to be before app.router + app.use(express.static(staticPath); + } + // manual helpers app.use(function(req, res, next) { app.locals.config = config; diff --git a/insight.js b/insight.js index d290dc0..040df23 100644 --- a/insight.js +++ b/insight.js @@ -85,7 +85,7 @@ require('./app/controllers/socket.js').init(expressApp, ios); //Start the app by listening on server.listen(config.port, function(){ - console.log('Express server listening on port %d in %s mode', server.address().port, process.env.NODE_ENV); + console.log('insight server listening on port %d in %s mode', server.address().port, process.env.NODE_ENV); }); //expose app diff --git a/package.json b/package.json index d3b9bc4..43bb2b2 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "name": "Ryan X Charles", "email": "ryan@bitpay.com" }, - "repository": "git://github.com/bitpay/insight.git", + "repository": "git://github.com/bitpay/insight-api.git", "contributors": [ { "name": "Matias Alejo Garcia", @@ -30,9 +30,9 @@ } ], "bugs": { - "url": "https://github.com/bitpay/insight/issues" + "url": "https://github.com/bitpay/insight-api/issues" }, - "homepage": "https://github.com/bitpay/insight", + "homepage": "https://github.com/bitpay/insight-api", "license": "MIT", "keywords": [ "insight", @@ -41,7 +41,9 @@ "riddle", "mystification", "puzzle", - "conundrum" + "conundrum", + "api", + "bitcore" ], "engines": { "node": "*"