2.33.0 • Published 1 year ago

@tiejs/redis v2.33.0

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

Redis plugin

Installation

$ npm i @tiejs/redis

Config

// config/plugin.ts

import { PluginConfig } from '@tiejs/common'

export const plugins: PluginConfig = [
  {
    name: 'redis',
    package: '@tiejs/redis',
    enable: true,
  },
]
// config/redis.ts

import { PluginConfig } from '@tiejs/common'

export const redis = {
  host: '1.14.165.196',
  port: 6379,
  password: '',
}

Usage

import { Controller, Get } from '@tiejs/controller'
import { Redis } from 'ioredis'
import { InjectRedisClient } from '@tiejs/redis'

@Controller()
export class HomeController {
  constructor(@InjectRedisClient() private redis: Redis) {}

  @Get('/')
  async index() {
    return {
      hello: 'hello world',
      greeting: await this.redis.get('greeting'),
    }
  }
}
2.33.0

1 year ago

2.32.0

1 year ago

2.31.0

2 years ago

2.30.0

2 years ago

2.29.0

2 years ago

2.28.0

2 years ago

2.27.0

2 years ago

2.26.0

2 years ago

2.25.0

2 years ago

2.24.0

2 years ago

2.11.0

3 years ago

2.12.0

3 years ago

2.10.0

3 years ago

2.19.0

3 years ago

2.17.0

3 years ago

2.18.0

3 years ago

2.15.0

3 years ago

2.16.0

3 years ago

2.13.0

3 years ago

2.14.0

3 years ago

2.21.0

2 years ago

2.23.0

2 years ago

2.20.0

2 years ago

2.22.0

2 years ago

2.3.0

3 years ago

2.5.0

3 years ago

2.4.0

3 years ago

2.7.0

3 years ago

2.6.0

3 years ago

2.9.0

3 years ago

2.8.0

3 years ago

1.15.0

3 years ago

2.2.0

3 years ago

1.17.0

3 years ago

1.16.0

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.14.1

3 years ago

1.14.0

3 years ago