@akanjs/server 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/boot.js +4 -4
package/package.json
CHANGED
package/src/boot.js
CHANGED
|
@@ -101,19 +101,18 @@ const createNestApp = async ({
|
|
|
101
101
|
AuthMiddleWare = __decorateClass([
|
|
102
102
|
(0, import_common2.Injectable)()
|
|
103
103
|
], AuthMiddleWare);
|
|
104
|
-
const redisClient = (0, import_redis.createClient)({ url: redisUri });
|
|
104
|
+
const redisClient = await (0, import_redis.createClient)({ url: redisUri }).connect();
|
|
105
105
|
let SubDatabaseModule = class {
|
|
106
106
|
};
|
|
107
107
|
SubDatabaseModule = __decorateClass([
|
|
108
108
|
(0, import_common2.Global)(),
|
|
109
109
|
(0, import_common2.Module)({
|
|
110
110
|
providers: [
|
|
111
|
-
{ provide: "REDIS_CLIENT",
|
|
111
|
+
{ provide: "REDIS_CLIENT", useValue: redisClient },
|
|
112
112
|
{
|
|
113
113
|
provide: "MEILI_CLIENT",
|
|
114
114
|
useFactory: () => new import_meilisearch.MeiliSearch({ host: meiliUri, apiKey: (0, import_nest.generateMeiliKey)(env) })
|
|
115
|
-
}
|
|
116
|
-
{ provide: import_core.APP_INTERCEPTOR, useClass: import_nest.CacheInterceptor }
|
|
115
|
+
}
|
|
117
116
|
],
|
|
118
117
|
exports: ["REDIS_CLIENT", "MEILI_CLIENT"]
|
|
119
118
|
})
|
|
@@ -176,6 +175,7 @@ const createNestApp = async ({
|
|
|
176
175
|
app.use((0, import_cookie_parser.default)());
|
|
177
176
|
app.useGlobalInterceptors(new import_nest.LoggingInterceptor());
|
|
178
177
|
app.useGlobalInterceptors(new import_nest.TimeoutInterceptor());
|
|
178
|
+
app.useGlobalInterceptors(new import_nest.CacheInterceptor(redisClient));
|
|
179
179
|
app.useGlobalFilters(new import_nest.AllExceptionsFilter());
|
|
180
180
|
await app.listen(process.env.PORT ?? env.port ?? 8080);
|
|
181
181
|
backendLogger.log(`\u{1F680} Server is running on: ${await app.getUrl()}`);
|