All files / exp app.js

66.67% Statements 12/18
50% Branches 2/4
33.33% Functions 1/3
70.59% Lines 12/17

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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    3x 3x 3x 3x   3x 3x     3x 3x   3x       3x 8x                 3x
'use strict'
 
const express = require('express')
const app = new express()
const config = require('./config/env')
require('./db')
// const {errorMid} = require('./middleware')
require('./service/kue.service')(app)
Iif (config.seedDB) { require('./config/seed')() }
 
// app.use(errorMid())
require('./config/horse')(app, config)
require('./routes')(app)
 
app.on('error', (err, ctx) => {
  console.error('----app--error---->', err)
})
 
process.on('message', function (msg) {
  Iif (msg === 'shutdown') {
    console.log('---- Closing all connections... ----')
    setTimeout(function () {
      console.log('---- Finished closing connections ----')
      process.exit(0)
    }, 1000)
  }
});
 
module.exports = app