src/controllers/express/router.js   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 20
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 12
mnd 1
bc 1
fnc 0
dl 0
loc 20
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
rs 10
1
import express from 'express';
2
import { updates } from 'src/config';
3
import controllers from './controllers';
4
5
const router = express.Router();
6
const { sessions, system, sns, telegram } = controllers;
7
8
// system
9
router.get('/health', system.health);
10
router.get('/info', system.info);
11
12
const useWebhook = updates.mode === 'webhook';
13
14
if (useWebhook) {
15
    router.post(`/updates/${updates.webhook}`, telegram.update);
16
}
17
18
router.post('/sns/:token', sessions.check, sessions.checkAWS, sns.event);
19
20
export default router;
21