cache.ts 400 B

123456789101112131415161718
  1. import { Redis } from '../lib/redis'
  2. import * as apicache from 'apicache'
  3. // Ensure Redis is initialized
  4. Redis.Instance.init()
  5. const options = {
  6. redisClient: Redis.Instance.getClient(),
  7. appendKey: () => Redis.Instance.getPrefix()
  8. }
  9. const cacheRoute = apicache.options(options).middleware
  10. // ---------------------------------------------------------------------------
  11. export {
  12. cacheRoute
  13. }