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