// Default values provided if no settings are included
NestMvcCoreModule.forRoot({
edgeTemplate: {
rootDir: join(process.cwd(), "resources", "views"),
disks: [],
cache: false,
},
vite: {
mode: "development",
buildOutDir: join(process.cwd(), "resources", "public", "builds"),
developServerUrl: "http://localhost:5173",
},
debug: false,
});
If you need to retrieve settings values like configService or require more detailed management, you can configure asynchronous settings using the options factory. The code below shows an example of providing asynchronous settings to NestMvcCoreModule by implementing NestMvcCoreOptionsFactory.
@Injectable()
export class NestMvcConfig implements NestMvcCoreOptionsFactory {
create(): NestMvcCoreOptions {
return {
rootDir: join(process.cwd(), "resources", "views"),
disks: [],
cache: false,
vite: {
mode: "development",
buildOutDir: join(process.cwd(), "resources", "public", "builds"),
developServerUrl: "http://localhost:5173",
},
debug: false,
};
}
}
NestMvcCoreModule.forRootAsync({
useClass: NestMvcConfig,
});