Completed
Push — master ( 4c6624...6253c1 )
by
unknown
01:41
created

get-generate-posts.js ➔ route   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
nc 2
dl 0
loc 16
rs 9.4285
c 1
b 0
f 0
cc 2
nop 2
1
import {
2
  abeExtend
3
} from '../../cli'
4
5
var route = function(req, res) {
6
  var result
7
  if (abeExtend.process('generate-posts', [''])) {
8
    result = {
9
      success: 1,
10
      msg: 'generate-posts is running'
11
    }
12
  }else {
13
    result = {
14
      success: 0,
15
      msg: 'cannot run process generate-posts, because an other one is already running'
16
    }
17
  }
18
  res.set('Content-Type', 'application/json')
19
  res.send(JSON.stringify(result))
20
}
21
22
export default route