209 похожих чатов

А, не все так просто. В общем то в чем была

моя ошибка я разобрался. Я думал, что в данной ситуации объект создается и инжектируется силами nestjs, но посмотрев код я нашел вот такое

private static createAsyncOptionsProvider(
options: TypeOrmModuleAsyncOptions,
): Provider {
if (options.useFactory) {
return {
provide: TYPEORM_MODULE_OPTIONS,
useFactory: options.useFactory,
inject: options.inject || [],
};
}
// as Type<TypeOrmOptionsFactory> is a workaround for microsoft/TypeScript#31603
const inject = [
(options.useClass || options.useExisting) as Type<TypeOrmOptionsFactory>,
];
return {
provide: TYPEORM_MODULE_OPTIONS,
useFactory: async (optionsFactory: TypeOrmOptionsFactory) =>
await optionsFactory.createTypeOrmOptions(options.name),
inject,
};
}

получается, что либо я у себя в коде модуля создаю фабрику руками, точно так же как это сделано у typeorm, либо свои проблемы решаю по другому как то.


В общем сдаюсь, мне надо в модуль auth прокинуть конфиг, чтобы прочитать секрет кей и еще что-то там нужное для jwt.
Как мне это сделать правильно?

1 ответов

14 просмотров

Лично я создаю неймспейсы и импортирую каждый в свой модуль через ConfigModule.forFeature, в доке подробно расписано как их создать

Похожие вопросы

Обсуждают сегодня

Guys what is ur real (no jokes) expectation of link price during this cycle?
Hobbyist
28
Hey everyone! How's your weekend going so far?
Noah Noure
17
Hey, it seems like a solid project for the gaming industry. What are your initial thoughts?
Josh
26
What got more people talking about FTM? The week we were biggest gainer or this week with loads of amazing news but no positive price movement? The week we were biggest gain...
Yankee Ruin X
11
Works for everyone else, you think think SOL organically went from $8 to $220? Of course it didn’t, they pumped it. First to $20 with the narrative it would go back to $100, ...
Yankee Ruin X
8
I am honored to report that all the deliverables for the BCHFAQ Flipstarter Phase 1 have been completed. I appreciate the opportunity I've had to put all this together using t...
fixthetracking
15
I honestly got a question to ask the idex team and all the idex supporters, I'm not sure if it's a good question for here but I will still ask. I got 930000$ coins do you thin...
Lennworth
7
Previous Q/A list response: Any news on usdl revamp? USDL revamp won’t be in name as that would cause too much issues with hardcoding. USDL revamp will be in the form of its ...
Sig | LGCY | BattleVerse L1 | BitWin
5
Why the price is plummeting even after such a bullish week?
Crypto Lover 💕
11
Hi everyone! I have a two-folded message to share today. First: updates and news, as we are being asked for those. We still want to go like we did the last 6 years: we w...
Marten | Unibright.io
31
Карта сайта