Comparing version 0.1.7 to 0.1.8
@@ -89,5 +89,6 @@ const lib = require("./lib.js"); | ||
app.get("/stats", req => { | ||
return lib.Response.json(req.get_stats()); | ||
console.log(req.get_stats()); | ||
return lib.Response.json(req.get_stats(true)); | ||
}); | ||
app.listen("127.0.0.1:1122"); |
10
lib.js
const core = require("./build/Release/ice_node_core"); | ||
const stat = require("./stat.js"); | ||
module.exports.static = require("./static.js"); | ||
@@ -288,6 +289,13 @@ | ||
Request.prototype.get_stats = function() { | ||
Request.prototype.get_stats = function(load_system_stats = false) { | ||
if(load_system_stats) { | ||
stat.update_system_stats(this); | ||
} | ||
return JSON.parse(core.get_stats_from_request(this.call_info)); | ||
} | ||
Request.prototype.set_custom_stat = function(k, v) { | ||
core.set_custom_stat(this.call_info, k, v); | ||
} | ||
module.exports.Response = Response; | ||
@@ -294,0 +302,0 @@ function Response({ status = 200, headers = {}, cookies = {}, body = "", file = null, template_name = null, template_params = {} }) { |
{ | ||
"name": "ice-node", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "Bindings for the Ice Web Framework", | ||
@@ -5,0 +5,0 @@ "main": "lib.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75755
20
736