mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-05 11:06:28 +00:00
52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
const winston = require("../../helpers/winston.logger");
|
|
require("dotenv").config();
|
|
|
|
// Get Service Code, Block, dan System Code
|
|
const controller = async (req, res) => {
|
|
try {
|
|
// check service block
|
|
if (
|
|
process.env.SERVICEBLOCK_SERVICE_MUTUAL == "" ||
|
|
process.env.SERVICEBLOCK_BLOCK_READ == "" ||
|
|
process.env.SERVICEBLOCK_BLOCK_WRITE == ""
|
|
) {
|
|
// create log
|
|
winston.logger.error(
|
|
`PLEASE CONFIGURE SERVICE BLOCK ON THE ENVIRONMENT!`
|
|
);
|
|
}
|
|
|
|
let sytemCode = "939E";
|
|
let serviceReadNS = "4B1017208B20";
|
|
let blockReadNS = "800081008200";
|
|
let serviceMutual = process.env.SERVICEBLOCK_SERVICE_MUTUAL;
|
|
let blockReadS = process.env.SERVICEBLOCK_BLOCK_READ;
|
|
let blockWrite = process.env.SERVICEBLOCK_BLOCK_WRITE;
|
|
let locFlag = 15;
|
|
return res.status(200).send({
|
|
code: "00",
|
|
message: "Get Service Succeess",
|
|
data: {
|
|
sysCode: sytemCode,
|
|
sReadNS: serviceReadNS,
|
|
sMutual: serviceMutual,
|
|
bReadNS: blockReadNS,
|
|
bReadS: blockReadS,
|
|
bWrite: blockWrite,
|
|
lFlag: locFlag,
|
|
},
|
|
});
|
|
} catch (error) {
|
|
return res.json({
|
|
code: "5001",
|
|
message:
|
|
process.env.NODE_ENV != "production"
|
|
? error.message
|
|
: "500 internal server error - backend server.",
|
|
data: {},
|
|
});
|
|
}
|
|
};
|
|
|
|
module.exports = controller;
|