index.js const express = require (" express ") const quicker = require (" ./quicker ") const app = express () app . get (" / ", ( req , res ) => { res . send (" hello ") }) app . get (" /health ", ( req , res ) => { const HealthData = { application: quicker . getApplicatonHealth (), system: quicker . getSystemHealth (), timestemp: Date . now (), } res . json ( HealthData ) }) app . listen ( 3000 , () => console . log (" app runnning on port 3000 ")) quicker.js const os = require (" os ") module . exports = { getSystemHealth : () => { return { cpuUsge: os . loadavg (), totalMemory: os . totalmem () / 1024 / 1024 + " MB ", freeMemory: os . freemem ...
Comments
Post a Comment