-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
46 lines (41 loc) · 1.25 KB
/
Copy pathconfig.js
File metadata and controls
46 lines (41 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"use strict";
// Use dotenv to read env.env vars into Node
// require("./env.env");
// Required environment variables
const ENV_VARS = [
"PAGE_ID",
"APP_ID",
"PAGE_TOKEN",
"APP_SECRET",
"VERIFY_TOKEN",
"APP_URL",
];
module.exports = {
// Messenger Platform API
mPlatformDomain: "https://graph.facebook.com",
mPlatformVersion: "v3.2",
// Page and Application information
pageId: process.env.PAGE_ID,
appId: process.env.APP_ID,
pageToken: process.env.PAGE_TOKEN,
appSecret: process.env.APP_SECRET,
verifyToken: process.env.VERIFY_TOKEN,
port: process.env.PORT || 3000,
checkEnvVariables: function() {
ENV_VARS.forEach(function(key) {
if (!process.env[key]) {
console.log("WARNING: Missing the environment variable " + key);
} else {
// Check that urls use https
if (["APP_URL"].includes(key)) {
const url = process.env[key];
if (!url.startsWith("https://")) {
console.log(
"WARNING: Your " + key + ' does not begin with "https://"'
);
}
}
}
});
}
};