Browse Source

Clean

pull/1076/head
Gibran Parvez 7 years ago
parent
commit
d7f6aefea4
  1. 10
      service/external.js
  2. 3
      test/unit/run.js

10
service/external.js

@ -1,19 +1,25 @@
"use strict";
const logger = require( 'pelias-logger' ).get( 'api' );
const axios = require('axios');
const geotransIP = process.env.GEOTRANS_IP;
function geotrans(coord) {
let result;
return axios.get(`http://${geotransIP}:3150`, {
let url = `http://${geotransIP}:3150`;
logger.info(`GET ${url}`);
return axios.get(url, {
params:{
'datum':'WGE',
'coord':coord
}
})
.then(function (response){
logger.info('200');
logger.info(response.data);
return response.data;
}).catch(function (reason){
logger.info('ERROR');
logger.info(reason);
return reason;
});
}

3
test/unit/run.js

@ -105,7 +105,8 @@ var tests = [
require('./service/configurations/PlaceHolder'),
require('./service/configurations/PointInPolygon'),
require('./service/mget'),
require('./service/search')
require('./service/search'),
require('./service/external')
];
tests.map(function(t) {

Loading…
Cancel
Save