Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let path = require("path");
let fs = require("fs");
let _ = require("lodash");
let chalk = require("chalk");
let Moleculer = require("moleculer");
let APIService = require("./api-service");
/* global WEBPACK_BUNDLE */
if (!WEBPACK_BUNDLE) require("require-webpack-compat")(module, require);
// Create cache module
let cacher;
if (config.cacheTimeout > 0) {
cacher = new Moleculer.Cachers.Memory({
ttl: config.cacheTimeout
});
}
// Create service broker
let broker = new Moleculer.ServiceBroker({
cacher,
logger,
logLevel: "debug",
nodeID: config.nodeID,
metrics: true,
statistics: false,
ServiceFactory: APIService
});
// Load services