aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/middlewares/cache.ts
blob: ef8611875b980c9768ceb137d1aaf6f6af0a6320 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                    
                                    
 

                              
 


                                             

 

                                                       


                                                                              
            
 
import { Redis } from '../lib/redis'
import * as apicache from 'apicache'

// Ensure Redis is initialized
Redis.Instance.init()

const options = {
  redisClient: Redis.Instance.getClient(),
  appendKey: () => Redis.Instance.getPrefix()
}

const cacheRoute = apicache.options(options).middleware

// ---------------------------------------------------------------------------

export {
  cacheRoute
}