From 52a42afbf6c29f3141e932b0d43f405629e9e6a9 Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Mon, 2 Mar 2020 20:31:50 +0000 Subject: [PATCH] Update nodeinfo with content-type Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- sample-functions/nodeinfo-http/handler.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sample-functions/nodeinfo-http/handler.js b/sample-functions/nodeinfo-http/handler.js index c59fef91..31104caf 100644 --- a/sample-functions/nodeinfo-http/handler.js +++ b/sample-functions/nodeinfo-http/handler.js @@ -10,6 +10,7 @@ module.exports = async (event, context) => { let res = await info(content) return context .status(200) + .headers("Content-Type", "text/plain") .succeed(res) } @@ -18,9 +19,10 @@ async function info(content, callback) { let val = ""; val += "Hostname: " + data +"\n"; - val += "Platform: " + os.platform()+"\n"; val += "Arch: " + os.arch() + "\n"; val += "CPU count: " + os.cpus().length+ "\n"; + val += "Total mem: "+ os.totalmem() + "\n"; + val += "Platform: " + os.platform()+"\n"; val += "Uptime: " + os.uptime()+ "\n";