Redisk for Nestjs
Module for using Redisk in NestJS.
Getting started
npm install redisk-nestjs redisk --save
Usage
import { Module } from '@nestjs/common';
import { RediskModule } from 'redisk-nestjs';
@Module({
imports: [
RediskModule.forRoot({
url: 'redis://127.0.0.1:6379/0',
}),
],
})
export class AppModule {}
Example
import { Controller, Get } from '@nestjs/common';
import { Redisk } from 'redisk';
@Controller('cats')
export class CatsController {
constructor(private readonly redisk: Redisk) {}
@Get()
async findAll(): Promise<Cat[]> {
return this.redisk.list<Cat>(Cat);
}
}