Adds guard and few debuggers for env

This commit is contained in:
Akshay Nair
2020-10-06 23:05:47 +05:30
parent b27e09c0eb
commit aae6f8d503
2 changed files with 9 additions and 4 deletions
+4 -4
View File
@@ -8,11 +8,11 @@ if (!process.env.CI) {
const { NC_USER, NC_API_KEY, NC_DOMAIN, IP_ADDRESS } = process.env;
module.exports = {
ENV,
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,
TTL: 5*60,
NC_USER,
NC_API_KEY,
IP_ADDRESS,
TTL: 5*60,
};
+5
View File
@@ -52,6 +52,11 @@ const getDomainService = ({ nc }) => {
return { getHosts, setHosts, updateHosts };
};
if (!NC_API_KEY) {
console.error('NC_API_KEY cannot be empty');
process.exit(1);
}
const nc = new Namecheap({
user: NC_USER,
key: NC_API_KEY,