localhost_oa_based/src/config/swagger.config.ts

13 lines
354 B
TypeScript
Raw Normal View History

2024-02-28 17:02:46 +08:00
import { ConfigType, registerAs } from '@nestjs/config';
2024-02-28 08:32:35 +08:00
2024-02-28 17:02:46 +08:00
import { env, envBoolean } from '~/global/env';
2024-02-28 08:32:35 +08:00
2024-02-28 17:02:46 +08:00
export const swaggerRegToken = 'swagger';
2024-02-28 08:32:35 +08:00
export const SwaggerConfig = registerAs(swaggerRegToken, () => ({
enable: envBoolean('SWAGGER_ENABLE'),
path: env('SWAGGER_PATH'),
2024-02-28 17:02:46 +08:00
}));
2024-02-28 08:32:35 +08:00
2024-02-28 17:02:46 +08:00
export type ISwaggerConfig = ConfigType<typeof SwaggerConfig>;