mirror of
https://github.com/laochan-eacnet/backend.git
synced 2026-09-28 17:58:10 +03:00
add js object to kxml decorator
add config warpper around environment variables
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import dotenv from 'dotenv';
|
||||
dotenv.config();
|
||||
|
||||
class Config {
|
||||
get port() {
|
||||
return process.env.PORT ? parseInt(process.env.PORT) : 10573;
|
||||
}
|
||||
|
||||
get selfUrl() {
|
||||
return process.env.SELF_URL ?? 'http://127.0.0.1:10573';
|
||||
}
|
||||
|
||||
get ntpUrl() {
|
||||
return process.env.NTP_URL ?? 'ntp://pool.ntp.org';
|
||||
}
|
||||
|
||||
get mongoUrl() {
|
||||
return process.env.MONGO_URL ?? 'mongodb://127.0.0.1:27017';
|
||||
}
|
||||
|
||||
get isDev() {
|
||||
return process.env.NODE_ENV !== 'production';
|
||||
}
|
||||
}
|
||||
|
||||
export const config = new Config();
|
||||
export default config;
|
||||
Reference in New Issue
Block a user