susee:log
This commit is contained in:
parent
ccd04b0d35
commit
921633b50f
@ -4,6 +4,8 @@ const { sequelize, Entities , Financials , Statementsmaster , Sectionsmaster ,
|
|||||||
const { logMsg } = require('../services/logger.js');
|
const { logMsg } = require('../services/logger.js');
|
||||||
const financialControllerHelper = require('../services/financial.controller.helper.js');
|
const financialControllerHelper = require('../services/financial.controller.helper.js');
|
||||||
const camundaHelper = require('../services/camunda.helper.js');
|
const camundaHelper = require('../services/camunda.helper.js');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -547,3 +549,118 @@ exports.MenuList = (req, res) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
exports.readLogFileName = async (req , res) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
folderName = req;
|
||||||
|
const logFilePath = 'storage/log';
|
||||||
|
|
||||||
|
const fileNames = fs.readdirSync(logFilePath);
|
||||||
|
// Remove the first element (0th index)
|
||||||
|
const [, ...data] = fileNames;
|
||||||
|
return data;
|
||||||
|
|
||||||
|
}
|
||||||
|
catch(err)
|
||||||
|
{
|
||||||
|
res.status(500).send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while inserting statements." ,'data': "No data"
|
||||||
|
});
|
||||||
|
} //end of try catch
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
exports.readLogFile = async (req , res) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
folderName = req.body.folder;
|
||||||
|
fileName = req.body.file;
|
||||||
|
const logFilePath = 'storage/log/'+fileName;
|
||||||
|
|
||||||
|
fs.readFile(logFilePath, 'utf8', (err, data) => {
|
||||||
|
if (err) {
|
||||||
|
console.error(err);
|
||||||
|
res.status(500).send({'status':404,'message': err.message || "Error reading log file." ,'data': "No data"});
|
||||||
|
}
|
||||||
|
res.send({'status':200 , message:"Success." ,'data': data});
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
catch(err)
|
||||||
|
{
|
||||||
|
res.status(500).send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while inserting statements." ,'data': "No data"
|
||||||
|
});
|
||||||
|
} //end of try catch
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
exports.viewLandingPage = async (req , res) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
moduleName = [ { "module":"FINANCIAL","folder":"smc_cet_financials_backend"} ];
|
||||||
|
img = []
|
||||||
|
for(const [index,val] of moduleName.entries())
|
||||||
|
{
|
||||||
|
fileName = await this.readLogFileName(val.folder);
|
||||||
|
console.log(fileName);
|
||||||
|
for (let i = 0; i < fileName.length; i++)
|
||||||
|
{
|
||||||
|
filePath = 'storage/log/'+fileName[i];
|
||||||
|
const logData = fs.readFileSync(filePath);
|
||||||
|
// Convert the file content to Base64
|
||||||
|
const base64Data = logData.toString('base64');
|
||||||
|
// Create Base64 URL from Base64 data
|
||||||
|
const base64Url = `data:application/octet-stream;base64,${encodeURIComponent(base64Data)}`;
|
||||||
|
img.push(base64Url)
|
||||||
|
}
|
||||||
|
moduleName[index] = await Object.assign(val,{'file':fileName , 'img':img});
|
||||||
|
};
|
||||||
|
res.render( 'module' , { 'data' : moduleName } ,function (err, html ) {
|
||||||
|
res.send(html)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
catch(err)
|
||||||
|
{
|
||||||
|
res.status(500).send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while inserting statements." ,'data': "No data"
|
||||||
|
});
|
||||||
|
} //end of try catch
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
exports.deleteLogFile = async (req , res) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
folderName = req.body.folder;
|
||||||
|
fileName = req.body.file;
|
||||||
|
|
||||||
|
// folderName = 'smc_cet_creditpd_backend';
|
||||||
|
// fileName = 'msg.log.2023-07-10';
|
||||||
|
const logFilePath = 'storage/log/'+fileName;
|
||||||
|
fs.unlink(logFilePath, (err) => {
|
||||||
|
if (err) {
|
||||||
|
console.error(`Error deleting file: ${err}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('File deleted successfully.');
|
||||||
|
res.send({'status':200 , message:"Success." ,'data': 'No data'});
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
catch(err)
|
||||||
|
{
|
||||||
|
res.status(500).send({'status':404,
|
||||||
|
message: err.message || "Some error occurred while inserting statements." ,'data': "No data"
|
||||||
|
});
|
||||||
|
} //end of try catch
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1130,6 +1130,15 @@ array.forEach((value, key)=>{
|
|||||||
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
router.get("/getfilename", test.readLogFileName);
|
||||||
|
|
||||||
|
router.post("/readlogs", test.readLogFile);
|
||||||
|
|
||||||
|
router.get("/view", test.viewLandingPage);
|
||||||
|
|
||||||
|
router.post("/deletelog", test.deleteLogFile);
|
||||||
|
|
||||||
// routes started here
|
// routes started here
|
||||||
app.use('/api', router);
|
app.use('/api', router);
|
||||||
|
|||||||
337
app/views/module.ejs
Normal file
337
app/views/module.ejs
Normal file
@ -0,0 +1,337 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
||||||
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
|
||||||
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background: #f3f3f3;
|
||||||
|
padding: 30px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Dashboard Cards */
|
||||||
|
.dashboard-cards {
|
||||||
|
position: relative;
|
||||||
|
padding-bottom: 50px;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card {
|
||||||
|
background: #ffffff;
|
||||||
|
display: inline-block;
|
||||||
|
-webkit-perspective: 1000;
|
||||||
|
perspective: 1000;
|
||||||
|
z-index: 20;
|
||||||
|
padding: 0 !important;
|
||||||
|
margin: 5px 5px 10px 5px;
|
||||||
|
position: relative;
|
||||||
|
text-align: left;
|
||||||
|
-webkit-transition: all 0.3s 0s ease-in;
|
||||||
|
transition: all 0.3s 0s ease-in;
|
||||||
|
z-index: 1;
|
||||||
|
/* width: calc(33.33333333% - 10px); */
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card:hover {
|
||||||
|
box-shadow: 0 15px 10px -10px rgba(31, 31, 31, 0.5);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card .card-title {
|
||||||
|
background: #ffffff;
|
||||||
|
padding: 20px 15px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card .card-title h2 {
|
||||||
|
font-size: 24px;
|
||||||
|
letter-spacing: -0.05em;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card .card-title h2 small {
|
||||||
|
display: block;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 8px;
|
||||||
|
letter-spacing: -0.025em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card .card-description {
|
||||||
|
position: relative;
|
||||||
|
font-size: 14px;
|
||||||
|
border-top: 1px solid #ddd;
|
||||||
|
padding: 10px 15px 0 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card .card-actions {
|
||||||
|
box-shadow: 0 2px 0px 0 rgba(0, 0, 0, 0.075);
|
||||||
|
padding: 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card .card-flap {
|
||||||
|
background: #d9d9d9;
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
-webkit-transform-origin: top;
|
||||||
|
transform-origin: top;
|
||||||
|
/* -webkit-transform: rotateX(-90deg);
|
||||||
|
transform: rotateX(-90deg); */
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card .flap1 {
|
||||||
|
-webkit-transition: all 0.3s 0.3s ease-out;
|
||||||
|
transition: all 0.3s 0.3s ease-out;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card .flap2 {
|
||||||
|
-webkit-transition: all 0.3s 0s ease-out;
|
||||||
|
transition: all 0.3s 0s ease-out;
|
||||||
|
z-index: -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards.showing .card {
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0.6;
|
||||||
|
-webkit-transform: scale(0.88);
|
||||||
|
transform: scale(0.88);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .no-touch .dashboard-cards.showing .card:hover {
|
||||||
|
opacity: 0.94;
|
||||||
|
-webkit-transform: scale(0.92);
|
||||||
|
transform: scale(0.92);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card.d-card-show {
|
||||||
|
opacity: 1 !important;
|
||||||
|
-webkit-transform: scale(1) !important;
|
||||||
|
transform: scale(1) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card.d-card-show .card-flap {
|
||||||
|
background: #ffffff;
|
||||||
|
-webkit-transform: rotateX(0deg);
|
||||||
|
transform: rotateX(0deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card.d-card-show .flap1 {
|
||||||
|
-webkit-transition: all 0.3s 0s ease-out;
|
||||||
|
transition: all 0.3s 0s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card.d-card-show .flap2 {
|
||||||
|
-webkit-transition: all 0.3s 0.2s ease-out;
|
||||||
|
transition: all 0.3s 0.2s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card .task-count {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
position: absolute;
|
||||||
|
top: 14px;
|
||||||
|
right: 10px;
|
||||||
|
background: #ecf0f1;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 40px;
|
||||||
|
border-radius: 100%;
|
||||||
|
color: #333333;
|
||||||
|
font-weight: 600;
|
||||||
|
transition: all .2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Task List */
|
||||||
|
.dashboard-cards .task-list {
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .task-list li {
|
||||||
|
padding: 10px 0;
|
||||||
|
padding-left: 10px;
|
||||||
|
margin: 3px 0;
|
||||||
|
list-style-type: none;
|
||||||
|
border-bottom: 1px solid #e9ebed;
|
||||||
|
border-left: 3px solid #f36525;
|
||||||
|
transition: all .2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .task-list li:hover {
|
||||||
|
background: #ecf0f1;
|
||||||
|
transition: all .2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .task-list li span {
|
||||||
|
float: right;
|
||||||
|
color: #f36525;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards.showing .card.d-card-show .task-count {
|
||||||
|
color: #ffffff;
|
||||||
|
background: #f36525;
|
||||||
|
transition: all .2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card-actions .btn {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-cards .card-actions .btn:hover {
|
||||||
|
color: #f36525;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fileName{
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.delete,.download{
|
||||||
|
float: right;
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-right: 1rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class='row dashboard-cards'>
|
||||||
|
<% for (let i = 0; i < data.length; i++) { %>
|
||||||
|
<div class='card col-md-2'></div>
|
||||||
|
<div class='card col-md-8'>
|
||||||
|
<div class='card-title'>
|
||||||
|
<h2>
|
||||||
|
LOGS
|
||||||
|
<!-- <small>You have 14 pending tasks</small> -->
|
||||||
|
</h2>
|
||||||
|
<div class='task-count'>
|
||||||
|
<%= data[i].file.length %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class='card-flap flap1'>
|
||||||
|
<% for (let j = 0; j < data[i].file.length; j++) { %>
|
||||||
|
<div class='card-description'>
|
||||||
|
<ul class='task-list'>
|
||||||
|
<li id="<%= data[i].file[j]+'|'+data[i].folder %>" class="fileName">
|
||||||
|
<%= data[i].file[j] %>
|
||||||
|
</li>
|
||||||
|
<button type="button" id="<%= data[i].file[j]+'|'+data[i].folder %>" class="btn btn-danger delete">Delete</button>
|
||||||
|
<a onclick="downloadImage('<%= data[i].img[j] %>')">Download link</a>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
|
<div class='card-flap flap2'>
|
||||||
|
<div class='card-actions'>
|
||||||
|
<a class='btn' href='#'>Close</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class='card col-md-2'></div>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Modal btn -->
|
||||||
|
<button type="button" style="display: none;" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Large Modal</button>
|
||||||
|
<!-- Modal -->
|
||||||
|
<div class="modal fade" id="myModal" role="dialog">
|
||||||
|
<div class="modal-dialog modal-lg">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title"></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" style="white-space: pre-wrap;">
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
var zindex = 10;
|
||||||
|
|
||||||
|
$("div.card").click(function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
var isShowing = false;
|
||||||
|
|
||||||
|
if ($(this).hasClass("d-card-show")) {
|
||||||
|
isShowing = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($("div.dashboard-cards").hasClass("showing")) {
|
||||||
|
// a card is already in view
|
||||||
|
$("div.card.d-card-show").removeClass("d-card-show");
|
||||||
|
|
||||||
|
if (isShowing) {
|
||||||
|
// this card was showing - reset the grid
|
||||||
|
$("div.dashboard-cards").removeClass("showing");
|
||||||
|
} else {
|
||||||
|
// this card isn't showing - get in with it
|
||||||
|
$(this).css({ zIndex: zindex }).addClass("d-card-show");
|
||||||
|
}
|
||||||
|
|
||||||
|
zindex++;
|
||||||
|
} else {
|
||||||
|
// no dashboard-cards in view
|
||||||
|
$("div.dashboard-cards").addClass("showing");
|
||||||
|
$(this).css({ zIndex: zindex }).addClass("d-card-show");
|
||||||
|
|
||||||
|
zindex++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$(".fileName").click(function(){
|
||||||
|
data = $(this).attr('id').split("|");
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: "/api/readlogs",
|
||||||
|
data: {'file' : data[0] , 'folder' : data[1]},
|
||||||
|
success: function(response) {
|
||||||
|
console.log(response);
|
||||||
|
$('.modal-title').html(data[0]);
|
||||||
|
$('.modal-body').html(response.data);
|
||||||
|
$('#myModal').modal('show');
|
||||||
|
},
|
||||||
|
error: function(jqXHR, textStatus, err) {
|
||||||
|
alert('text status '+textStatus+', err '+err)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$(".delete").click(function(){
|
||||||
|
data = $(this).attr('id').split("|");
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: "/api/deletelog",
|
||||||
|
data: {'file' : data[0] , 'folder' : data[1]},
|
||||||
|
success: function(response) {
|
||||||
|
console.log(response);
|
||||||
|
location.reload();
|
||||||
|
},
|
||||||
|
error: function(jqXHR, textStatus, err) {
|
||||||
|
alert('text status '+textStatus+', err '+err)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function downloadImage(data)
|
||||||
|
{
|
||||||
|
const base64Image = data; // Replace this with your actual Base64 image data
|
||||||
|
const downloadLink = document.createElement('a');
|
||||||
|
downloadLink.href = base64Image;
|
||||||
|
downloadLink.download = 'log.txt'; // Replace with the desired file name and extension
|
||||||
|
downloadLink.click();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</html>
|
||||||
106
package-lock.json
generated
106
package-lock.json
generated
@ -564,7 +564,6 @@
|
|||||||
"version": "4.3.0",
|
"version": "4.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"color-convert": "^2.0.1"
|
"color-convert": "^2.0.1"
|
||||||
}
|
}
|
||||||
@ -992,7 +991,6 @@
|
|||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"color-name": "~1.1.4"
|
"color-name": "~1.1.4"
|
||||||
}
|
}
|
||||||
@ -1233,6 +1231,14 @@
|
|||||||
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
||||||
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
|
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
|
||||||
},
|
},
|
||||||
|
"ejs": {
|
||||||
|
"version": "3.1.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz",
|
||||||
|
"integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==",
|
||||||
|
"requires": {
|
||||||
|
"jake": "^10.8.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
"emoji-regex": {
|
"emoji-regex": {
|
||||||
"version": "7.0.3",
|
"version": "7.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
|
||||||
@ -1377,6 +1383,32 @@
|
|||||||
"moment": "^2.11.2"
|
"moment": "^2.11.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"filelist": {
|
||||||
|
"version": "1.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz",
|
||||||
|
"integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==",
|
||||||
|
"requires": {
|
||||||
|
"minimatch": "^5.0.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"brace-expansion": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||||
|
"requires": {
|
||||||
|
"balanced-match": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"minimatch": {
|
||||||
|
"version": "5.1.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
||||||
|
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
||||||
|
"requires": {
|
||||||
|
"brace-expansion": "^2.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"fill-range": {
|
"fill-range": {
|
||||||
"version": "7.0.1",
|
"version": "7.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||||
@ -1440,6 +1472,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
||||||
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
|
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
|
||||||
},
|
},
|
||||||
|
"fs": {
|
||||||
|
"version": "0.0.1-security",
|
||||||
|
"resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
|
||||||
|
"integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
|
||||||
|
},
|
||||||
"fs-constants": {
|
"fs-constants": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
|
||||||
@ -1881,6 +1918,54 @@
|
|||||||
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
|
||||||
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
|
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
|
||||||
},
|
},
|
||||||
|
"jake": {
|
||||||
|
"version": "10.8.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz",
|
||||||
|
"integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==",
|
||||||
|
"requires": {
|
||||||
|
"async": "^3.2.3",
|
||||||
|
"chalk": "^4.0.2",
|
||||||
|
"filelist": "^1.0.4",
|
||||||
|
"minimatch": "^3.1.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"async": {
|
||||||
|
"version": "3.2.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz",
|
||||||
|
"integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ=="
|
||||||
|
},
|
||||||
|
"chalk": {
|
||||||
|
"version": "4.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||||
|
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||||
|
"requires": {
|
||||||
|
"ansi-styles": "^4.1.0",
|
||||||
|
"supports-color": "^7.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"has-flag": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
|
||||||
|
},
|
||||||
|
"minimatch": {
|
||||||
|
"version": "3.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||||
|
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||||
|
"requires": {
|
||||||
|
"brace-expansion": "^1.1.7"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"supports-color": {
|
||||||
|
"version": "7.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||||
|
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||||
|
"requires": {
|
||||||
|
"has-flag": "^4.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"js-yaml": {
|
"js-yaml": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
||||||
@ -2480,6 +2565,15 @@
|
|||||||
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
||||||
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
|
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
|
||||||
},
|
},
|
||||||
|
"path": {
|
||||||
|
"version": "0.12.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz",
|
||||||
|
"integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==",
|
||||||
|
"requires": {
|
||||||
|
"process": "^0.11.1",
|
||||||
|
"util": "^0.10.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"path-is-absolute": {
|
"path-is-absolute": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||||
@ -3309,6 +3403,14 @@
|
|||||||
"prepend-http": "^2.0.0"
|
"prepend-http": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"util": {
|
||||||
|
"version": "0.10.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
|
||||||
|
"integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
|
||||||
|
"requires": {
|
||||||
|
"inherits": "2.0.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"util-deprecate": {
|
"util-deprecate": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||||
|
|||||||
@ -13,9 +13,12 @@
|
|||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"dotenv": "^10.0.0",
|
"dotenv": "^10.0.0",
|
||||||
|
"ejs": "^3.1.9",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
|
"fs": "0.0.1-security",
|
||||||
"log4js": "^6.3.0",
|
"log4js": "^6.3.0",
|
||||||
"mssql": "^7.2.0",
|
"mssql": "^7.2.0",
|
||||||
|
"path": "^0.12.7",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
"sequelize": "^6.6.5",
|
"sequelize": "^6.6.5",
|
||||||
"swagger-jsdoc": "^6.1.0",
|
"swagger-jsdoc": "^6.1.0",
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
const express = require('express')
|
const express = require('express')
|
||||||
const app = express()
|
const app = express();
|
||||||
|
const path = require('path');
|
||||||
//it is used to clear cache
|
//it is used to clear cache
|
||||||
app.use(function(req, res, next) {
|
app.use(function(req, res, next) {
|
||||||
res.set("Cache-Control", "no-cache, no-store, must-revalidate, max-age=0")
|
res.set("Cache-Control", "no-cache, no-store, must-revalidate, max-age=0")
|
||||||
@ -10,6 +11,9 @@ app.use(function(req, res, next) {
|
|||||||
})
|
})
|
||||||
const {logMsg} = require('./app/services/logger.js');
|
const {logMsg} = require('./app/services/logger.js');
|
||||||
|
|
||||||
|
app.set('views', path.join(__dirname, 'app\\views'));
|
||||||
|
app.set('view engine', 'ejs');
|
||||||
|
|
||||||
const swaggerJsdoc = require('swagger-jsdoc');
|
const swaggerJsdoc = require('swagger-jsdoc');
|
||||||
const swaggerUi = require('swagger-ui-express');
|
const swaggerUi = require('swagger-ui-express');
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user