torrents.csv/server/ui/set_env.js

12 lines
395 B
JavaScript
Raw Normal View History

2018-12-02 06:10:42 +00:00
require('dotenv').config();
const fs = require('fs');
exports.setEnv = function() {
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
}