step 2 : try build
This commit is contained in:
15
build/config/config.js
Normal file
15
build/config/config.js
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs_1 = require("fs");
|
||||
const j_config = JSON.parse((0, fs_1.readFileSync)("./config-etl-tat.json").toString());
|
||||
const config = {
|
||||
base_url: j_config["base_url"],
|
||||
schedule: j_config["schedule"],
|
||||
delay: j_config["delay"],
|
||||
row_per_batch: j_config["row_per_batch"],
|
||||
// kode, date, target
|
||||
// kode: j_config["kode"],
|
||||
// date: j_config["date"],
|
||||
// target: j_config["target"]
|
||||
};
|
||||
exports.default = config;
|
||||
41
build/config/logging.js
Normal file
41
build/config/logging.js
Normal file
@@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const moment_1 = __importDefault(require("moment"));
|
||||
const getTimeStamp = () => {
|
||||
const dt = (0, moment_1.default)().format("yyyy-MM-DD HH:mm:ss");
|
||||
return dt;
|
||||
};
|
||||
const info = (namespace, message, object) => {
|
||||
if (object) {
|
||||
console.log(`[${getTimeStamp()}] [INFO] [${namespace}] [${message}]`, object);
|
||||
}
|
||||
else {
|
||||
console.log(`[${getTimeStamp()}] [INFO] [${namespace}] [${message}]`);
|
||||
}
|
||||
};
|
||||
const warning = (namespace, message, object) => {
|
||||
if (object) {
|
||||
console.log(`[${getTimeStamp()}] [WARNING] [${namespace}] [${message}]`, object);
|
||||
}
|
||||
else {
|
||||
console.log(`[${getTimeStamp()}] [WARNING] [${namespace}] [${message}]`);
|
||||
}
|
||||
};
|
||||
const error = (namespace, message, object) => {
|
||||
if (object) {
|
||||
console.log(`[${getTimeStamp()}] [ERROR] [${namespace}] [${message}]`, object);
|
||||
}
|
||||
else {
|
||||
console.log(`[${getTimeStamp()}] [ERROR] [${namespace}] [${message}]`);
|
||||
}
|
||||
};
|
||||
const delay = (time) => new Promise((res) => setTimeout(res, time));
|
||||
exports.default = {
|
||||
info,
|
||||
warning,
|
||||
error,
|
||||
delay,
|
||||
};
|
||||
Reference in New Issue
Block a user