Skip to content

koexjs/cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cluster

NPM version Coverage Status Dependencies Build Status license issues

cluster for koa extend.

Install

$ npm install @koex/cluster

Usage

  • 1 command line
  • 2 import { startApp } from 'cluster';
// app.js / app.ts
import * as Koa from 'koa';

const app = new Koa();

app.use(ctx => {
  ctx.body = 'hi, koa-cluster';
});

export default app;

// 1 command line
> koex-cluster app.js

// 2 code: server.js
import { startApp } from '@koex/cluster';
import app from './app';

startApp(app.callback(), {
  port: 8000,
  host: '0.0.0.0',
});

Related