Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ bitcoind must be running and must have finished downloading the blockchain **bef
## Quick Install
Check the Prerequisites section above before installing.

To install Insight, clone the main repository:
To install Insight API, clone the main repository:

$ git clone git@github.com:bitpay/insight.git && cd insight
$ git clone git@github.com:bitpay/insight-api.git && cd insight-api

Install dependencies:

Expand Down
6 changes: 6 additions & 0 deletions app/controllers/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
'use strict';

var config = require('../../config/config');

var _getVersion = function() {
var pjson = require('../../package.json');
return pjson.version;
};

exports.render = function(req, res) {
if (config.publicPath) {
return res.sendfile(config.publicPath + '/index.html');
}

var version = _getVersion();
res.send('insight API v' + version);
};
Expand Down
11 changes: 6 additions & 5 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ var path = require('path'),

if (process.env.INSIGHT_NETWORK === 'livenet') {
env = 'livenet';
db = './db';
db = rootPath + '/db';
port = '3000';
b_port = '8332';
p2p_port = '8333';
}
else {
env = 'testnet';
db = './db/testnet';
db = rootPath + '/db/testnet';
port = '3001';
b_port = '18332';
p2p_port = '18333';
Expand Down Expand Up @@ -50,6 +50,7 @@ dataDir += network === 'testnet' ? 'testnet3' : '';

module.exports = {
root: rootPath,
publicPath: process.env.INSIGHT_PUBLIC_PATH || false,
appName: 'Insight ' + env,
apiPrefix: '/api',
port: port,
Expand All @@ -68,11 +69,11 @@ module.exports = {
network: network,
disableP2pSync: false,
disableHistoricSync: false,
poolMatchFile: './etc/minersPoolStrings.json',
poolMatchFile: rootPath + '/etc/minersPoolStrings.json',

// Time to refresh the currency rate. In minutes
currencyRefresh: 10,
keys: {
segmentio: process.env.INSIGHT_SEGMENTIO_KEY
}
segmentio: process.env.INSIGHT_SEGMENTIO_KEY
}
};
4 changes: 2 additions & 2 deletions config/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ 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);
if (config.publicPath) {
var staticPath = path.normalize(config.rootPath + '/../' + config.publicPath);

//IMPORTANT: for html5mode, this line must to be before app.router
app.use(express.static(staticPath));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "insight-bitcore-api",
"description": "An open-source bitcoin blockchain API. The Insight API provides you with a convenient, powerful and simple way to query and broadcast data on the bitcoin network and build your own services with it.",
"version": "0.1.2",
"version": "0.1.3",
"author": {
"name": "Ryan X Charles",
"email": "ryan@bitpay.com"
Expand Down