const { Redis } = require('expresso-provider')
import { Redis } from 'expresso-provider'
// config/redis.ts
import { Redis } from 'expresso-provider'
export const redisService = new Redis({
host: '127.0.0.1',
port: 6379,
password: 'your_password',
})
import { redisService } from 'config/redis'
import { ms } from 'expresso-core'
const keyRedis = 'your_key'
const storeRedis = {
'text': 'any value'
}
const expires = ms('10m')
// Set Redis
await redisService.set(keyRedis, JSON.stringify(storeRedis), {
timeout: expires,
})
// Get Redis
const getStore = redisService.get(keyRedis)