feat(config): Allow config to be edited without rebuild

This commit is contained in:
Taso committed 2021-04-11 09:38:20 -04:00
1 parent 1a3d02f1e3
commit a880ae66ea
9 files changed
+19 -11

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
import { pool } from './db';
import config from '../utils/config';
import { config } from './server';
import { mainLogger } from './sv_logger';
import { Player, Players, PlayersByIdentifier } from './players/sv_players';
+6
View File
@@ -1,4 +1,10 @@
import { Server } from 'esx.js';
import { IServerConfig } from '../../typings/config';
// Setup and export config loaded at runtime
export const config: IServerConfig = JSON.parse(
LoadResourceFile(GetCurrentResourceName(), 'config.json'),
);
import './db';
import './sv_twitter';
+2 -3
View File
@@ -1,5 +1,5 @@
import winston from 'winston';
import config from '../utils/config';
import { config } from './server';
import path from 'path';
// Needed to manually apply a color to componenent property of log
@@ -13,8 +13,7 @@ const formatLogs = (log: winston.Logform.TransformableInfo): string => {
return `${log.label} [${log.level}]: ${log.message}`;
};
const findLogPath = () =>
`${path.join(GetResourcePath(GetCurrentResourceName()), 'sv_npwd.log')}`;
const findLogPath = () => `${path.join(GetResourcePath(GetCurrentResourceName()), 'sv_npwd.log')}`;
// Initiate the main logger for NPWD
export const mainLogger = winston.createLogger({
+1 -1
View File
@@ -2,7 +2,7 @@ import { ResultSetHeader, RowDataPacket } from 'mysql2';
import { pool } from './db';
import { getIdentifier, getSource } from './functions';
import config from '../utils/config';
import { config } from './server';
import { Like, Match, Profile, MatchEvents, NewProfile } from '../../typings/match';
import { mainLogger } from './sv_logger';
import { generateProfileName } from './players/sv_players';
+1 -1
View File
@@ -2,7 +2,7 @@ import { ResultSetHeader } from 'mysql2';
import { pool } from './db';
import { getIdentifier, getSource } from './functions';
import { NewTweet, Tweet, Profile } from '../../typings/twitter';
import config from '../utils/config';
import { config } from './server';
import { reportTweetToDiscord } from './discord';
import { mainLogger } from './sv_logger';
import { generateProfileName, getDefaultProfileNames } from './players/sv_players';