1
0
Fork 0
peertube/server/middlewares/cache.ts

19 lines
400 B
TypeScript
Raw Normal View History

2018-04-17 12:01:06 +00:00
import { Redis } from '../lib/redis'
import * as apicache from 'apicache'
2018-04-17 12:01:06 +00:00
// Ensure Redis is initialized
Redis.Instance.init()
const options = {
redisClient: Redis.Instance.getClient(),
appendKey: () => Redis.Instance.getPrefix()
2018-04-17 12:01:06 +00:00
}
const cacheRoute = apicache.options(options).middleware
2018-04-17 12:01:06 +00:00
// ---------------------------------------------------------------------------
export {
2018-07-24 12:35:11 +00:00
cacheRoute
2018-04-17 12:01:06 +00:00
}