Changes env file

This commit is contained in:
Akshay Nair
2020-10-05 16:43:57 +05:30
parent db974e1848
commit 7f982a1908
3 changed files with 8 additions and 6 deletions
+1
View File
@@ -1,3 +1,4 @@
NC_USER=xxx
NC_API_KEY=xxxxxxxxxxxxxxx
NC_DOMAIN=domain.com
IP_ADDRESS=100.100.100.100
+2 -2
View File
@@ -1,5 +1,5 @@
const R = require('ramda');
const { VALID_RECORD_TYPES, TTL } = require('../utils/constants');
const { VALID_RECORD_TYPES, TTL, ENV } = require('../utils/constants');
const { domainService: dc } = require('../utils/domain-service');
const { getDomains: gd } = require('../utils/domain');
@@ -28,7 +28,7 @@ const registerDomains = async ({ domainService, getDomains }) => {
};
const main = async () => {
console.log('Registering domains...');
console.log(`Registering domains in ${ENV}...`);
const result = await registerDomains({ domainService: dc, getDomains: gd });
console.log(result);
};
+5 -4
View File
@@ -1,14 +1,15 @@
const path = require('path');
require('dotenv').config({ path: path.resolve('.env.sandbox') });
const { ENV = 'sandbox' } = process.env;
require('dotenv').config({ path: path.resolve(`.env.${ENV}`) });
const { NC_USER, NC_API_KEY, NC_DOMAIN } = process.env;
const { NC_USER, NC_API_KEY, NC_DOMAIN, IP_ADDRESS } = process.env;
module.exports = {
VALID_RECORD_TYPES: ['CNAME', 'A', 'ALIAS', 'URL'],
NC_DOMAIN: NC_DOMAIN || 'booboo.xyz',
NC_USER: NC_USER || 'test',
NC_API_KEY: NC_API_KEY || 'fake_key',
ENV: 'sandbox',
ENV,
TTL: 5*60,
IP_ADDRESS: '100.100.100.100',
IP_ADDRESS,
};