• HUZZAH!!!!! Thank you!!

    
    
    htypes=["Temp","RH","Pressure","AirQual"­,"Clear","Red","Green","Blue"];
    
    function writeTypedHistory(res,tdx) {
      var typen = htypes[tdx];
      res.write((tdx === 0) ? '{"' : ',"');
      res.write(typen);
      res.write('":');
      res.write(JSON.stringify(HISTORY[typen])­);
      if (++tdx < htypes.length) {
        setTimeout(writeTypedHistory,200,res,tdx­);
      } else {
        res.write('}');
        res.end();
      }
    }
    
    
    
    function processrequest(req, res) {
    	try {
    		var par=url.parse(req.url,true);
    		var q=par.query; 
    		var path=par.pathname; 
    		path=path.split('/');
    		path=path[1];
    	    switch(path) {
    	    	case "history.json":
    			res.writeHead(200,head);
    			setTimeout(writeTypedHistory,10,res,0);
    	    		break;
    <snip>
    	    }
    	}
    	catch (err){
    		res.writeHead(500,head);
    	    res.write("{status:\"error\",error:\""+e­rr.message+"\"}");
    		res.end();
    	}
    }
    
About

Avatar for DrAzzy @DrAzzy started