mirror of
https://github.com/Discreetly/server.git
synced 2026-01-10 13:08:07 -05:00
25 lines
584 B
TypeScript
25 lines
584 B
TypeScript
import type { ServerI } from 'discreetly-interfaces';
|
|
import 'dotenv/config';
|
|
|
|
let SERVER_ID = 0n;
|
|
let NAME = 'undefined';
|
|
|
|
try {
|
|
SERVER_ID = process.env.SERVER_ID ? (process.env.SERVER_ID as unknown as bigint) : 0n;
|
|
console.log('SERVERID:', SERVER_ID);
|
|
} catch (error) {
|
|
console.error('Error reading serverID from .env file!');
|
|
}
|
|
|
|
try {
|
|
NAME = process.env.SERVER_NAME ? process.env.SERVER_NAME : 'localhost';
|
|
} catch (err) {
|
|
console.error('Error reading PORT from .env file!');
|
|
}
|
|
|
|
export const serverConfig: ServerI = {
|
|
id: SERVER_ID,
|
|
name: NAME,
|
|
version: '0.0.2'
|
|
};
|