This commit is contained in:
赵鑫 2022-09-05 07:15:14 +08:00
parent e665a2f453
commit 4263bf1af8

View File

@ -14,7 +14,7 @@ const server = http.createServer(function (request, response) {
response.setHeader('Access-Control-Allow-Headers', 'Origin,X-Requested-With,Authorization,Content-Type,Accept,Z-Key') response.setHeader('Access-Control-Allow-Headers', 'Origin,X-Requested-With,Authorization,Content-Type,Accept,Z-Key')
response.setHeader('Content-Type', 'application/json') response.setHeader('Content-Type', 'application/json')
try { try {
const temp_string = fs.readFileSync(TEMPERATURE_FILE_PATH) const temp_string = Number(fs.readFileSync(TEMPERATURE_FILE_PATH))
const meminfo_string = String(fs.readFileSync(MEMINFO_FILE_PATH)) const meminfo_string = String(fs.readFileSync(MEMINFO_FILE_PATH))
const meminfo_total = meminfo_string.match(/MemTotal\:\s+(\d+) kB/) const meminfo_total = meminfo_string.match(/MemTotal\:\s+(\d+) kB/)
const meminfo_available = meminfo_string.match(/MemAvailable\:\s+(\d+) kB/) const meminfo_available = meminfo_string.match(/MemAvailable\:\s+(\d+) kB/)