-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathenv.module.ts
More file actions
55 lines (41 loc) · 1.19 KB
/
env.module.ts
File metadata and controls
55 lines (41 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import {
EnvModuleMixin,
ApplicationLogLevel,
TransformBooleanString,
TransformArrayString,
} from '@spuxx/nest-utils';
import { IsBoolean, IsIn, IsNumber, IsString, IsUrl } from 'class-validator';
class Env {
@IsString()
@IsIn(Object.values(ApplicationLogLevel))
APP_LOG_LEVEL: ApplicationLogLevel = ApplicationLogLevel.Default;
@IsString()
APP_BASE_URL: string = 'https://api.spuxx.dev';
@IsString()
APP_PORT: string = '8080';
@TransformArrayString()
@IsString({ each: true })
CORS_ALLOWED_ORIGINS: string[] = ['https://toledo.spuxx.dev'];
@IsUrl()
AUTH_ISSUER_URL: string = 'https://auth.spuxx.dev/realms/main';
@IsString()
AUTH_CLIENT_ID: string = 'spuxx-api';
@IsString()
AUTH_CLIENT_SECRET: string;
@IsString()
AUTH_COOKIE_SECRET: string;
@IsString()
DATABASE_HOST: string = 'mariadb.database.svc.cluster.local';
@IsNumber()
DATABASE_PORT: number = 3306;
@IsString()
DATABASE_USERNAME: string;
@IsString()
DATABASE_PASSWORD: string;
@IsString()
DATABASE_DB: string = 'spuxx-api-production';
@TransformBooleanString()
@IsBoolean()
DATABASE_SYNCHRONIZE: boolean = true;
}
export class EnvModule extends EnvModuleMixin<Env>(Env) {}