Commit 4c2bf5924809dcaf16971ae942377b1163ab96b9

Authored by Adhidarma Hadiwinoto
1 parent 1dce6b7b58
Exists in master

Add "/" handler on callback

Showing 1 changed file with 12 additions and 0 deletions Side-by-side Diff

lib/callback/index.js
... ... @@ -87,6 +87,18 @@ app.use('/apikey/:apikey/prepaid', handlerPrepaid);
87 87 app.use('/apikey/:apikey/TOPUP', handlerPrepaid);
88 88 app.use('/apikey/:apikey/:hitType', handlerPostpaid);
89 89  
  90 +app.use('/', (req, res) => {
  91 + const { xid } = res.locals;
  92 +
  93 + res.json({
  94 + status: 'OK',
  95 + error: null,
  96 + ts: new Date(),
  97 + message: 'Have you RTFM?',
  98 + xid,
  99 + });
  100 +});
  101 +
90 102 app
91 103 .listen(listenPort, () => {
92 104 logger.info(`${MODULE_NAME} F702D60D: Callback listener ready to get request`, {