2018-12-02 06:10:42 +00:00
|
|
|
require('dotenv').config();
|
|
|
|
const fs = require('fs');
|
|
|
|
|
2018-12-25 23:19:16 +00:00
|
|
|
exports.setEnv = function() {
|
2019-02-27 02:59:30 +00:00
|
|
|
let endpoint = (process.env.TORRENTS_CSV_ENDPOINT) ? process.env.TORRENTS_CSV_ENDPOINT : "http://0.0.0.0:8080";
|
2019-02-21 02:35:27 +00:00
|
|
|
let env_line = `export const endpoint = '${endpoint}';`;
|
|
|
|
fs.writeFile("src/env.ts", env_line, function (err) {
|
|
|
|
console.log("Wrote src/env.ts:");
|
|
|
|
console.log("\t" + env_line);
|
|
|
|
});
|
2018-12-02 06:10:42 +00:00
|
|
|
}
|