mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-01-24 05:37:56 -05:00
wtf is NODE_ENV
This commit is contained in:
committed by
Alec LaLonde
parent
9cf6d910d5
commit
bad08bf200
@@ -1,5 +1,6 @@
|
||||
interface IConfig {
|
||||
port: number;
|
||||
nodeEnv: string;
|
||||
graphqlURL: string;
|
||||
daoHausGraphqlURL: string;
|
||||
daoHausPolygonGraphqlURL: string;
|
||||
@@ -29,6 +30,7 @@ function parseEnv<T extends string | number>(
|
||||
|
||||
export const CONFIG: IConfig = {
|
||||
port: parseEnv(process.env.PORT, 4000),
|
||||
nodeEnv: parseEnv(process.env.NODE_ENV, 'local'),
|
||||
graphqlURL: (() => {
|
||||
const { GRAPHQL_URL: url, GRAPHQL_HOST: host } = process.env;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* eslint-disable no-console */
|
||||
import { createDiscordClient } from '@metafam/discord-bot';
|
||||
|
||||
import { CONFIG } from '../../config';
|
||||
import { Player, PlayerRank_Enum } from '../../lib/autogen/hasura-sdk';
|
||||
import { client } from '../../lib/hasuraClient';
|
||||
import { TriggerPayload } from './types';
|
||||
@@ -14,7 +15,7 @@ export interface UpdateRole {
|
||||
}
|
||||
|
||||
export const updateDiscordRole = async (payload: TriggerPayload<Player>) => {
|
||||
if (process.env.NODE_ENV !== 'production') return;
|
||||
if (CONFIG.nodeEnv !== 'production') return;
|
||||
|
||||
const { old: oldPlayer, new: newPlayer } = payload.event.data;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user