Move config to .env
This commit is contained in:
16
package-lock.json
generated
16
package-lock.json
generated
@@ -10,7 +10,8 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"discord-webhook-node": "^1.1.8"
|
"discord-webhook-node": "^1.1.8",
|
||||||
|
"dotenv": "^16.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/asynckit": {
|
"node_modules/asynckit": {
|
||||||
@@ -69,6 +70,14 @@
|
|||||||
"node": ">= 6"
|
"node": ">= 6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dotenv": {
|
||||||
|
"version": "16.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
|
||||||
|
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/follow-redirects": {
|
"node_modules/follow-redirects": {
|
||||||
"version": "1.15.2",
|
"version": "1.15.2",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
|
||||||
@@ -214,6 +223,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"dotenv": {
|
||||||
|
"version": "16.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
|
||||||
|
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ=="
|
||||||
|
},
|
||||||
"follow-redirects": {
|
"follow-redirects": {
|
||||||
"version": "1.15.2",
|
"version": "1.15.2",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"discord-webhook-node": "^1.1.8"
|
"discord-webhook-node": "^1.1.8",
|
||||||
|
"dotenv": "^16.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
|
require('dotenv').config()
|
||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
const { STATUS_CODES } = require('http');
|
const { STATUS_CODES } = require('http');
|
||||||
const { Webhook, MessageBuilder } = require('discord-webhook-node');
|
const { Webhook, MessageBuilder } = require('discord-webhook-node');
|
||||||
|
|
||||||
// API endpoint URL to ping
|
// API endpoint URL to ping
|
||||||
const apiUrl = 'https://toho.mnz.gg/api/v1/ping';
|
const apiUrl = process.env.API_URL;
|
||||||
|
|
||||||
// Discord webhook URL to send messages
|
// Discord webhook URL to send messages
|
||||||
const webhookUrl = 'https://discord.com/api/webhooks/1110880167536099328/GE6T1D81sGFvG08EOMdAo3sL1WIizowu-t78An0L9fcbgL6BAkoH0Lu74rtilS1KJUqO';
|
const webhookUrl = process.env.WEBHOOK;
|
||||||
|
|
||||||
// Create a new Discord webhook instance
|
// Create a new Discord webhook instance
|
||||||
const webhook = new Webhook(webhookUrl);
|
const webhook = new Webhook(webhookUrl);
|
||||||
|
|||||||
Reference in New Issue
Block a user