I need one solution. I am using `axios` module to fetch response from other server and after that I need to export value to other file using Node.js. I am explaining my code below.

```
const axios = require('axios');
let protocol = '';
let opticalIp = '';

axios.get(`www.mydomain.com/api`).then(function(response) {
    //console.log('succ', response);
    if(response.data && response.data.data) {
        protocol = response.data.data['scheme'];
        opticalIp = response.data.data['optical_ip'];
    }
}).catch(function(error) {
    console.log('error', error);
});
console.log('data', opticalIp);

const env = {
    API_URL: `${protocol}://${opticalIp}/`,
    configHeaders: ''
};

module.exports = env;

```

Here I am fetching the data from other server and also here I am returning some `env` value to other file. In my case before response the `env` object is returning so that the `API_URL` value is going blank. Here I need after the success response the `API_URL` will be prepared and then this `env` object should return to other file where ever it is called. Please help me to get the proper solution.