Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
app.get('/api/cache/index', (req, res) => {
res.json(apicache.getIndex())
})
const getCacheIndex = res => {
const cacheIndex = {};
if (redisClient) {
redisClient.keys('*', (err, keys) => {
cacheIndex.memCacheIndex = apiCache.getIndex();
cacheIndex.redisIndex = keys;
res.json(cacheIndex);
});
} else {
cacheIndex.memCacheIndex = apiCache.getIndex();
res.json(cacheIndex);
}
};
app.get('/api/cache/index', (req, res) => {
res.json(apicache.getIndex());
});
//static content
server.get('/api/cache/index', function(req, res, next) {
return res.status(200).send(apicache.getIndex());
});
server.get('/api/cache/clear', function(req, res, next) {