Edit path for the metrics.json
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
				
			|||||||
const fs = require("fs")
 | 
					const fs = require("fs")
 | 
				
			||||||
const path = require("path")
 | 
					const path = require("path")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var metricsPathFile = metricsPathFile
 | 
					var metricsPathFile = "./metrics.json"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module.exports.getDate = function (formated) {
 | 
					module.exports.getDate = function (formated) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -52,7 +52,7 @@ module.exports.setMetricsFile = (path) => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module.exports.getMetricsFile = () => {
 | 
					module.exports.getMetricsFile = () => {
 | 
				
			||||||
    if(!fs.existsSync()) {
 | 
					    if(!fs.existsSync(metricsPathFile)) {
 | 
				
			||||||
        fs.writeFileSync(metricsPathFile, JSON.stringify([], null, 2))
 | 
					        fs.writeFileSync(metricsPathFile, JSON.stringify([], null, 2))
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        return JSON.parse(fs.readFileSync(metricsPathFile))
 | 
					        return JSON.parse(fs.readFileSync(metricsPathFile))
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "webmetrik",
 | 
					  "name": "webmetrik",
 | 
				
			||||||
  "version": "0.1.3",
 | 
					  "version": "0.1.4",
 | 
				
			||||||
  "description": "NodeJS - npm package - Make metrics and make it available by making a httpServer",
 | 
					  "description": "NodeJS - npm package - Make metrics and make it available by making a httpServer",
 | 
				
			||||||
  "main": "main.js",
 | 
					  "main": "main.js",
 | 
				
			||||||
  "keywords": [],
 | 
					  "keywords": [],
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user