Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var messages = [];
var pub = redis.createClient();
var sub = redis.createClient();
// setup redis publisher and subscriber
sub.subscribe("message", "sync");
pub.on("connect", redisConnectionHandler);
sub.on("connect", redisConnectionHandler);
pub.on("end", redisEndHandler);
sub.on("end", redisEndHandler);
pub.on("error", redisErrorHandler);
sub.on("error", redisErrorHandler);
// force logger to run restify version. (default is express, forcing express is also legal)
log.forceLogger("restify");
// set the logging level threshold
log.setLoggingLevel("info");
// register names of custom fields
log.registerCustomFields(["node_version", "pid", "platform"])
// setup serving of static files
app.get("/*", restify.plugins.serveStatic({
directory: "./public",
default: "index.html"
}));
// insert the logger as middleware to log each request.
app.use(log.logNetwork);
var messages = [];
var pub = redis.createClient();
var sub = redis.createClient();
// setup redis publisher and subscriber
sub.subscribe("message", "sync");
pub.on("connect", redisConnectionHandler);
sub.on("connect", redisConnectionHandler);
pub.on("end", redisEndHandler);
sub.on("end", redisEndHandler);
pub.on("error", redisErrorHandler);
sub.on("error", redisErrorHandler);
// force logger to run restify version. (default is express, forcing express is also legal)
log.forceLogger("restify");
// set the minimum logging level
log.setLoggingLevel("info");
// setup serving of static files
app.get("/*", restify.plugins.serveStatic({
directory: "./public",
default: "index.html"
}));
// insert the logger as middleware to log each request.
app.use(log.logNetwork);
// parse body json params
app.use(restify.plugins.bodyParser({ mapParams: true }));