You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
661 B

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