var requirejs = require('../../../../r');
var fs = require('fs');
var path = require('path');
var apiUrl = requirejs('../components/config/config').apiUrl;

var result = '';
for (var key in apiUrl) {
    result += 'proxy ^\\\/' + key + ' ' + apiUrl[key] + '\n';
}

fs.writeFile(path.join(__dirname, 'server.conf'), result, function (err) {
    if (err) throw err;
    console.log('has finished');
});