diff --git a/api/bin/www b/api/index.js similarity index 77% rename from api/bin/www rename to api/index.js index 5650961f..2cd99f4e 100755 --- a/api/bin/www +++ b/api/index.js @@ -3,7 +3,7 @@ 'use strict'; var config = require('config'); -var BitcoreHTTP = require('../app'); +var BitcoreHTTP = require('./lib/http'); var app = BitcoreHTTP.create(config.get('BitcoreHTTP')); app.start(); diff --git a/api/app.js b/api/lib/http.js similarity index 96% rename from api/app.js rename to api/lib/http.js index f56812ca..afec7f41 100644 --- a/api/app.js +++ b/api/lib/http.js @@ -9,9 +9,9 @@ var morgan = require('morgan'); var bitcore = require('bitcore'); var $ = bitcore.util.preconditions; -var BitcoreNode = require('../lib/node'); +var BitcoreNode = require('../../lib/node'); -var routes = require('./routes'); +var routes = require('../routes'); function BitcoreHTTP(node, opts) { diff --git a/api/routes/index.js b/api/routes/index.js index 64a1fd86..6289cd35 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -1,5 +1,6 @@ 'use strict'; + var express = require('express'); var router = express.Router(); @@ -10,9 +11,8 @@ function initRouter(node) { router.use('/v1', v1); router.use('/v2', v2); - router.get('/', function(req, res, next) { + router.get('/', function(req, res) { res.send('bitcore-node API'); - next(); }); return router; diff --git a/index.js b/index.js old mode 100755 new mode 100644