I have a server.js file inside a connections folder that I'm trying to use and have all my azure functions reference so that it doesn't instantiate a connection after every API call. I'm having issues exporting the connection and importing it correctly in my azure functions. Is this not possible. If it is, what am I doing wrong? Appreciate the help!
server.js
const redis = require('redis');
var mongoose = require('mongoose');
const redis = require('redis');
const client = redis.createClient(6380, process.env.REDISCACHEHOSTNAME + '.redis.cache.windows.net', {
auth_pass: process.env.REDISCACHEKEY,
tls: { servername: process.env.REDISCACHEHOSTNAME + '.redis.cache.windows.net' }
});
module.exports = { client };
top of azure function file importing connection
const redis = require('redis');
var redisConnection = require("../connections/server")
console.log("THE CLIENT IS " + redisConnection.client.connected);
Error: client is not defined


