How to use the egg.startCluster function in egg

To help you get started, we’ve selected a few egg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wechatpivot / wechatpivot / index.js View on Github external
'use strict';

// npm run dev DO NOT read this file

require('egg').startCluster({
  baseDir: __dirname,
  port: process.env.PORT || 7001, // default to 7001
});
github xjchenhao / Learn / egg-example / egg-example / index.js View on Github external
'use strict';

// npm run dev DO NOT read this file(npm运行dev不读这个文件)

require('egg').startCluster({
  baseDir: __dirname,
  port: process.env.PORT || 7001, // default to 7001
});
github BroKun / relationship-server-egg-typescript / index.js View on Github external
'use strict';

// npm run dev DO NOT read this file

require('egg').startCluster({
  baseDir: __dirname,
  port: process.env.PORT || 8080, // default to 8080
});
github DXY-F2E / api-mocker / server / index.js View on Github external
process.env.NODE_ENV = 'production'

require('egg').startCluster({
  // 若需要https服务,请取消注释,并配置好证书文件
  // https: true,
  // key: '{{key_file}}',
  // cert: '{{crt_file}}',
  baseDir: __dirname,
  workers: 4,
  port: process.env.PORT || 7001 // default to 7001
})
github leoDreamer / letchat-server / index.js View on Github external
'use strict';

// npm run dev DO NOT read this file

require('egg').startCluster({
  baseDir: __dirname,
  port: process.env.PORT || 7001, // default to 7001
});
github macacajs / macaca-datahub / index.js View on Github external
process.env.DATAHUB_VIEW_CONFIG_ASSETSURL = options.view.assetsUrl;
    }

    process.env.DATAHUB_RPC_PROTOCOL = options.protocol;
    process.env.EGG_SERVER_ENV = options.mode;
    process.env.EGG_MASTER_LOGGER_LEVEL = 'ERROR';

    const socketIoPort = await detectPort(options.socketIoPort);
    process.env.DATAHUB_SOCKET_IO_PORT = socketIoPort;

    const serverPort = await detectPort(options.port);
    const inDocker = process.env.RUN_MODE === 'docker';
    const ip = inDocker ? '127.0.0.1' : ipv4;
    const host = chalk.cyan.underline(`http://${ip}:${(serverPort)}`);
    console.log(`${EOL}DataHub server start at: ${host}${EOL}`);
    return eggServer.startCluster({
      workers: 1,
      port: serverPort,
      baseDir: __dirname,
    });
  }
}
github TeanBlog / TeanBlog / index.js View on Github external
require('egg').startCluster({
  baseDir: __dirname,
  workers: process.env.WORKERS,
  port:    process.env.PORT
});
github okoala / egg-vue-typescript-apollo-graphql-startkit / index.js View on Github external
const config = require('./config/config.default')

require('egg').startCluster({
  baseDir: __dirname,
  port: config.port,
  workers: process.env.PORT || config.workers
})
github easy-team / egg-vue-webpack-boilerplate / index.js View on Github external
process.env.VUE_ENV = 'server';
require('egg').startCluster({
  baseDir: __dirname,
  workers: process.env.WORKERS,
  port: process.env.PORT
});