add config

This commit is contained in:
Jurgis Sakalauskas
2022-12-08 21:20:35 +02:00
parent b938f1a3ba
commit b353e00bec
3 changed files with 34 additions and 6 deletions
+13
View File
@@ -0,0 +1,13 @@
import * as Dotenv from 'dotenv';
const dotenv: any = Dotenv.config().parsed;
class Config {
public readonly port = dotenv.PORT;
getPort() {
return process.env.PORT;
}
//todo - check dotenv again if not loaded before emmiting err.
//works globally, loaded once
}
export default new Config();