I have an NestJS application wich consist of many modules: databaseModule, userModule, devicesModule, etc. They all packaged to one module ApplicationModule, which handle server actions.
But now I need to add some lambda function to my project and I need to exec some methods from databaseModule, but I don't know how to do it.
Pseudo code that I imagine:
export const handler: Handler = (event: any, context: Context, callback) => {
const dbModule = DataBaseModule.build();
dbModule.get(UserService).createProject('my_project');
callback(null, event);
};
I think that nestjs should have similar functionality but I can't find it on official page.
P.S. I can't use just UserService because it depends on other services and providers in DatabaseModule. That is why I want this module to be fully configured and I can use its services