Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.init = function() {
if (config.httpKeepAlive !== true) {
// Disable the http Agent of the http-proxy library so we force
// the proxy to close the connection after each request to the backend
httpProxy._getAgent = function () {
return false;
};
}
httpProxy.setMaxSockets(config.maxSockets);
function readRoutesJson(){
fs.readFile("./config/routes.json", function (err, data) {
if (err) {
console.error("Error reading file");
}
routesJson = JSON.parse(data);
});
}
readRoutesJson();
fs.watchFile("./config/routes.json", function () {
readRoutesJson();