add ALTCHA challenge endpoint and env config.
GET /api/altcha/challenge, nullcart-style env validation, and ALTCHA_ENABLED wiring.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ConfigModule, ConfigService, registerAs } from '@nestjs/config';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { getAppConfig, getPostgresConfig } from './config';
|
||||
import { getAltchaConfig, getAppConfig, getPostgresConfig } from './config';
|
||||
import { validate } from './config/validate';
|
||||
import { AltchaModule } from './modules/altcha/AltchaModule';
|
||||
import { HealthCheckModule } from './modules/healthCheck/HealthCheckModule';
|
||||
import { StorageModule } from './modules/storage/StorageModule';
|
||||
import { UploadModule } from './modules/upload/UploadModule';
|
||||
@@ -11,13 +13,19 @@ import { Config } from './types/Config';
|
||||
imports: [
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
load: [registerAs('postgres', getPostgresConfig), registerAs('app', getAppConfig)]
|
||||
validate,
|
||||
load: [
|
||||
registerAs('postgres', getPostgresConfig),
|
||||
registerAs('app', getAppConfig),
|
||||
registerAs('altcha', getAltchaConfig)
|
||||
]
|
||||
}),
|
||||
TypeOrmModule.forRootAsync({
|
||||
useFactory: (configService: ConfigService) => configService.get('postgres') as Config['postgres'],
|
||||
inject: [ConfigService]
|
||||
}),
|
||||
HealthCheckModule,
|
||||
AltchaModule,
|
||||
StorageModule,
|
||||
UploadModule
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user