Skip to main content
Deno 2 is finally here 🎉️
Learn more

oak_nest_redis_module

This is a redis module for oak_nest.

example

import { Module } from "https://deno.land/x/oak_nest@v0.6.5/mod.ts";
import { AppController } from "./app.controller.ts";
import { RedisModule } from "https://deno.land/x/oak_nest_redis_module@v0.0.1/mod.ts";

@Module({
  imports: [
    RedisModule.forRoot({
      port: 6379,
      hostname: "192.168.21.176",
      password: "123456",
    }),
  ],
  controllers: [AppController],
})
export class AppModule {}

Then can be used in AppController:

import { RedisService } from "https://deno.land/x/oak_nest_redis_module@v0.0.1/mod.ts";
import { Controller, Get } from "https://deno.land/x/oak_nest@v0.6.5/mod.ts";

@Controller("")
export class AppController {
  constructor(private readonly redisService: RedisService) {}
  @Get("/")
  version() {
    this.redisService.set("version", "1.0.0");
    return this.redisService.get("version");
  }
}

More can see the example dir.