Code coverage report for cluster-coverage/worker.js

Statements: 100% (9 / 9)      Branches: 100% (2 / 2)      Functions: 100% (1 / 1)      Lines: 100% (9 / 9)      Ignored: none     

All files » cluster-coverage/ » worker.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37                                2   2   2 2 1         1 1         2 2    
/**!
 * worker process
 *
 * Copyright(c) fengmk2 and other contributors.
 * MIT Licensed
 *
 * Authors:
 *   fengmk2 <m@fengmk2.com> (http://fengmk2.com)
 */
 
'use strict';
 
/**
 * Module dependencies.
 */
 
const koa = require('koa');
 
const app = koa();
 
app.use(function* () {
  if (this.query.uid) {
    return this.body = {
      uid: this.query.uid,
    };
  }
 
  this.status = 403;
  this.body = {
    error: 'please login first'
  };
});
 
app.listen(1984);
console.log('[worker#%d] start listening on 1984, running_under_istanbul: %s', 
  process.pid, process.env.running_under_istanbul);