feat: support custom environment file path via CUSTOM_ENV_PATH variable
This commit is contained in:
parent
ef15273a02
commit
ce334cf6f4
|
|
@ -1,6 +1,9 @@
|
||||||
import { config } from 'dotenv';
|
import { config } from 'dotenv';
|
||||||
import { hostname } from 'os';
|
import { hostname } from 'os';
|
||||||
config();
|
|
||||||
|
declare const CUSTOM_ENV_PATH: string;
|
||||||
|
const envPath = typeof CUSTOM_ENV_PATH !== 'undefined' ? CUSTOM_ENV_PATH : './.env';
|
||||||
|
config({ path: envPath });
|
||||||
|
|
||||||
const generateInstanceId = () => {
|
const generateInstanceId = () => {
|
||||||
return process.env.INSTANCE_ID || hostname() || `kord-${Math.random().toString(36).substring(2, 7)}`;
|
return process.env.INSTANCE_ID || hostname() || `kord-${Math.random().toString(36).substring(2, 7)}`;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue