Harden bot, storage and web API
This commit is contained in:
parent
e974bc6660
commit
20624a5c9c
43 changed files with 1265 additions and 1012 deletions
|
|
@ -1,10 +1,7 @@
|
|||
const requiredVariables = [
|
||||
"NODE_ENV",
|
||||
"LOCATION",
|
||||
"BOT_OWNER",
|
||||
"DISCORD_GUILD_ID",
|
||||
"SHINUWA_USER_ID",
|
||||
"INVITE_LINK",
|
||||
"WEB_SERVER_PORT",
|
||||
"WEB_API_KEY",
|
||||
"DISCORD_APPLICATION_ID",
|
||||
|
|
@ -26,17 +23,18 @@ if (missingVariables.length > 0) {
|
|||
|
||||
const webServerPort = Number(process.env.WEB_SERVER_PORT);
|
||||
|
||||
if (!Number.isInteger(webServerPort) || webServerPort <= 0) {
|
||||
throw new Error("WEB_SERVER_PORT doit être un entier positif");
|
||||
if (
|
||||
!Number.isInteger(webServerPort) ||
|
||||
webServerPort <= 0 ||
|
||||
webServerPort > 65_535
|
||||
) {
|
||||
throw new Error("WEB_SERVER_PORT doit être compris entre 1 et 65535");
|
||||
}
|
||||
|
||||
const config = Object.freeze({
|
||||
environnement: process.env.NODE_ENV,
|
||||
location: process.env.LOCATION,
|
||||
botOwner: process.env.BOT_OWNER,
|
||||
discordGuildId: process.env.DISCORD_GUILD_ID,
|
||||
shinuwaUserId: process.env.SHINUWA_USER_ID,
|
||||
inviteLink: process.env.INVITE_LINK,
|
||||
webServerPort,
|
||||
webApiKey: process.env.WEB_API_KEY,
|
||||
applicationId: process.env.DISCORD_APPLICATION_ID,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue