Remove /config endpoint
We seem to have went with stashing relevant configuration onto `/poll/:currency` result.
This commit is contained in:
parent
204932f4f9
commit
bd1963fb6a
2 changed files with 0 additions and 79 deletions
|
|
@ -61,13 +61,6 @@ var send = function(req, res) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var configurations = function(req, res) {
|
|
||||||
res.json({
|
|
||||||
err: _config.exchanges && _config.exchanges.settings ? null : new Error('Settings Not Found!'),
|
|
||||||
results: _config.exchanges.settings
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var pair = function(req, res) {
|
var pair = function(req, res) {
|
||||||
var token = req.body.token;
|
var token = req.body.token;
|
||||||
var name = req.body.name;
|
var name = req.body.name;
|
||||||
|
|
@ -95,7 +88,6 @@ exports.init = function(app, config, lamassuConfig, authMiddleware) {
|
||||||
exports._transferExchange = api._transferExchange;
|
exports._transferExchange = api._transferExchange;
|
||||||
|
|
||||||
app.get('/poll/:currency', authMiddleware, poll);
|
app.get('/poll/:currency', authMiddleware, poll);
|
||||||
app.get('/config', authMiddleware, configurations);
|
|
||||||
app.post('/trade', authMiddleware, trade);
|
app.post('/trade', authMiddleware, trade);
|
||||||
app.post('/send', authMiddleware, send);
|
app.post('/send', authMiddleware, send);
|
||||||
app.post('/pair', pair);
|
app.post('/pair', pair);
|
||||||
|
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
/*
|
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
||||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
||||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var assert = require('chai').assert;
|
|
||||||
|
|
||||||
var LamassuConfig = require('lamassu-config');
|
|
||||||
var con = 'psql://lamassu:lamassu@localhost/lamassu';
|
|
||||||
var config = new LamassuConfig(con);
|
|
||||||
|
|
||||||
var jsonquest = require('jsonquest');
|
|
||||||
var express = require('express');
|
|
||||||
var app = express();
|
|
||||||
var testPort = 4000;
|
|
||||||
|
|
||||||
var cfg;
|
|
||||||
|
|
||||||
describe('configurations test', function(){
|
|
||||||
|
|
||||||
beforeEach(function(done) {
|
|
||||||
|
|
||||||
app.listen(testPort);
|
|
||||||
config.load(function(err, results) {
|
|
||||||
assert.isNull(err);
|
|
||||||
assert.ok(results.ok);
|
|
||||||
|
|
||||||
cfg = results.config;
|
|
||||||
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
it('should get configurations from remote server', function(done) {
|
|
||||||
this.timeout(1000000);
|
|
||||||
|
|
||||||
var api = require('../../lib/atm-api');
|
|
||||||
api.init(app, cfg);
|
|
||||||
|
|
||||||
// make the request
|
|
||||||
setTimeout(function() {
|
|
||||||
jsonquest({
|
|
||||||
host: 'localhost',
|
|
||||||
port: testPort,
|
|
||||||
path: '/config',
|
|
||||||
method: 'GET',
|
|
||||||
protocol: 'http'
|
|
||||||
}, function (err, res, body) {
|
|
||||||
assert.isNull(err);
|
|
||||||
assert.equal(res.statusCode, 200);
|
|
||||||
|
|
||||||
assert.isNull(body.err);
|
|
||||||
assert.ok(body.results);
|
|
||||||
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
}, 2000);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue