herowio-redisk-nestjs
v3.0.0
Published
NestJS module for Redisk.
Downloads
1
Readme
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({
host: '127.0.0.1',
port:6379,
db: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);
}
}