Skip to content

Commit

Permalink
Update nodeinfo with content-type
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Mar 2, 2020
1 parent b74cd09 commit 52a42af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sample-functions/nodeinfo-http/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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";

Expand Down

0 comments on commit 52a42af

Please sign in to comment.