@kenniy/godeye-data-contracts
Version:
Enterprise-grade base repository architecture for GOD-EYE microservices with zero overhead and maximum code reuse
58 lines (57 loc) • 1.63 kB
TypeScript
/**
* GOD-EYE Application Bootstrap
* One-line setup for standardized NestJS microservice configuration
*/
import { INestApplication } from '@nestjs/common';
/**
* Bootstrap configuration options
*/
export interface BootstrapConfig {
serviceName: string;
port?: number;
globalPrefix?: string;
enableSwagger?: boolean;
corsEnabled?: boolean;
swagger?: {
enabled?: boolean;
title?: string;
description?: string;
version?: string;
path?: string;
customOptions?: any;
docUrl?: string;
maxDisplayRequestSize?: number;
maxDisplayResponseSize?: number;
};
cors?: {
enabled?: boolean;
origins?: string[];
credentials?: boolean;
};
validation?: {
whitelist?: boolean;
forbidNonWhitelisted?: boolean;
transform?: boolean;
};
beforeStart?: (app: INestApplication) => Promise<void> | void;
}
/**
* Bootstrap a GOD-EYE microservice with standardized configuration
*
* @param appModule - The root application module
* @param config - Bootstrap configuration options
* @returns Promise<INestApplication> - The configured NestJS application
*/
export declare function bootstrap(appModule: any, config: BootstrapConfig): Promise<INestApplication>;
/**
* Legacy bootstrap function for backward compatibility
* @deprecated Use bootstrap() instead
*/
export declare function bootstrapGodsEyeApp(options: {
module: any;
appName: string;
port?: number;
globalPrefix?: string;
enableSwagger?: boolean;
enableCors?: boolean;
}): Promise<void>;