@xnestjs/redisess
v1.12.3
Published
NestJS extension library for redisess
Readme
@xnestjs/redisess
NestJS extension library for Redisess
Install
npm install @xnestjs/redisess
# or using yarn
yarn add @xnestjs/redisessUsage
Register sync
An example of nestjs module that import the @xnestjs/mongodb
// module.ts
import { Module } from '@nestjs/common';
import { RedisessModule } from '@xnestjs/redisess';
const client = new Redis();
@Module({
imports: [
RedisessModule.forRoot({
useValue: {
client,
namespace: 'sessions',
},
}),
],
})
export class MyModule {}Register async
An example of nestjs module that import the @xnestjs/mongodb async
// module.ts
import { Module } from '@nestjs/common';
import { RedisessModule } from '@xnestjs/redisess';
const client = new Redis();
@Module({
imports: [
RedisessModule.forRootAsync({
inject: [ConfigModule],
useFactory: (config: ConfigService) => ({
client,
namespace: config.get('SESSION_NAMESPACE'),
}),
}),
],
})
export class MyModule {}Environment Variables
The library supports configuration through environment variables. Environment variables below is accepted. All environment variables starts with prefix (RMQ_). This can be configured while registering the module.
