import cluster from 'cluster' import { cpus } from 'os' import { startServer } from './index' let numCpu = cpus().length if (process.env.ENVIRONMENT === 'localhost') { // Set the Max CPUs allowed on dev to 1 numCpu = 1 } if (cluster.isPrimary) { for (let i = 0; i < numCpu; i += 1) { cluster.fork() } } else { startServer() } /* Example object * * * { name: "camelCaseName", env: "PROD", version: "1.0.0", query: "PascalCase_With_Underscores_For_NameSpacing", auth: "jwt_string", data: { ... // Specific data to the obj }, results: { name: "camelCaseNameForResults", include: [ { name: "camelCaseName", key: "keyNameToInclude" } ], exclude: [ { key: "keyNameToExclude" } ] } } * * */