mirror of https://github.com/pelias/api.git
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
29 lines
661 B
"use strict"; |
|
|
|
const logger = require( 'pelias-logger' ).get( 'api' ); |
|
const axios = require('axios'); |
|
const geotransIP = process.env.GEOTRANS_IP; |
|
|
|
function geotrans(coord) { |
|
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; |
|
}); |
|
} |
|
|
|
module.exports = { |
|
geotrans: geotrans |
|
}; |