mirror of
https://github.com/openfaas/faas.git
synced 2025-06-18 20:16:37 +00:00
add metrics and sample node.js function
This commit is contained in:
9
sample-functions/Dockerfile
Normal file
9
sample-functions/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
FROM alpine:latest
|
||||
RUN apk --update add nodejs
|
||||
COPY ./fwatchdog /usr/bin/
|
||||
|
||||
COPY package.json .
|
||||
COPY main.js .
|
||||
RUN npm i
|
||||
ENV fprocess="node main.js"
|
||||
CMD ["fwatchdog"]
|
3
sample-functions/main.js
Normal file
3
sample-functions/main.js
Normal file
@ -0,0 +1,3 @@
|
||||
'use strict'
|
||||
let os = require('os');
|
||||
console.log(os.platform(), os.arch(), os.cpus(), os.uptime(), os.userInfo());
|
12
sample-functions/package.json
Normal file
12
sample-functions/package.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "sample-functions",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
}
|
Reference in New Issue
Block a user