mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-02 14:38:46 +00:00
50 lines
1.6 KiB
TypeScript
50 lines
1.6 KiB
TypeScript
import { Server } from 'esx.js';
|
|
import { ResourceConfig } from '../../typings/config';
|
|
import { RewriteFrames } from '@sentry/integrations';
|
|
|
|
// Setup and export config loaded at runtime
|
|
export const config: ResourceConfig = JSON.parse(
|
|
LoadResourceFile(GetCurrentResourceName(), 'config.json'),
|
|
);
|
|
|
|
// Setup controllers
|
|
import './db';
|
|
import './players/player.controller';
|
|
import './calls/calls.controller';
|
|
import './notes/notes.controller';
|
|
import './contacts/contacts.controller';
|
|
import './photo/photo.controller';
|
|
import './messages/messages.controller';
|
|
import './marketplace/marketplace.controller';
|
|
import './twitter/twitter.controller';
|
|
import './match/match.controller';
|
|
import './bank/bank.controller';
|
|
|
|
import './sv_main';
|
|
import { mainLogger } from './sv_logger';
|
|
import * as Sentry from '@sentry/node';
|
|
import * as Tracing from '@sentry/tracing';
|
|
|
|
// Setup sentry tracing
|
|
if (config.debug.sentryEnabled && process.env.NODE_ENV === 'production') {
|
|
Sentry.init({
|
|
dsn: 'https://[email protected]/3',
|
|
integrations: [new RewriteFrames()],
|
|
release: process.env.SENTRY_RELEASE || '0.0.0',
|
|
// Set tracesSampleRate to 1.0 to capture 100%
|
|
// of transactions for performance monitoring.
|
|
// We recommend adjusting this value in production
|
|
tracesSampleRate: 1.0,
|
|
});
|
|
}
|
|
|
|
export let ESX: Server = null;
|
|
|
|
emit('esx:getSharedObject', (obj: Server) => (ESX = obj));
|
|
|
|
on('onServerResourceStart', (resource: string) => {
|
|
if (resource === GetCurrentResourceName()) {
|
|
mainLogger.info('Sucessfully started');
|
|
}
|
|
});
|