mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-08-20 08:23:55 +00:00
Adds guard and few debuggers for env
This commit is contained in:
+4
-4
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user