-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only client is used as function (using node runtime): Usage: ``` echo '{ "hostname": "ifconfig.io", "port": 80 , "path":"/all.json" }' \ | curl -H "Content-Type: application/json" -X POST -d @- \ https://rzr.o6s.io/iotjs-express ``` Relate-to: github.com/openfaas/openfaas-cloud/pull/523 Change-Id: I49ca87f508a52e922414f86cbce2e40487fb023a Signed-off-by: Philippe Coval <p.coval@samsung.com>
- Loading branch information
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/echo docker build . -f | ||
# -*- coding: utf-8 -*- | ||
# SPDX-License-Identifier: MIT | ||
#{ | ||
# Copyright 2019-present Samsung Electronics France SAS, and other contributors | ||
# | ||
# This Source Code Form is subject to the terms of the MIT Licence | ||
# If a copy of the MIT was not distributed with this file | ||
# You can obtain one at: | ||
# https://spdx.org/licenses/MIT.html | ||
#} | ||
|
||
FROM rzrfreefr/iotjs-express:latest | ||
LABEL maintainer "Philippe Coval (p.coval@samsung.com)" | ||
|
||
ENV project iotjs-express-openfaas | ||
COPY . /usr/local/opt/${project}/src/${project}/ | ||
WORKDIR /usr/local/opt/${project}/src/${project}/ | ||
|
||
ADD https://github.com/openfaas/faas/releases/download/0.6.9/fwatchdog /usr/bin | ||
RUN chmod +x /usr/bin/fwatchdog | ||
|
||
ENV read_timeout="60" | ||
ENV write_timeout="60" | ||
ENV fprocess="xargs iotjs --help" | ||
|
||
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1 | ||
CMD [ "fwatchdog" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"use strict" | ||
var ClientRequest = require('iotjs-express/example/client'); | ||
|
||
module.exports = (context, callback) => { | ||
ClientRequest(JSON.parse(context || {}), callback); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "function", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "handler.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"iotjs-express": "0.0.12" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 1.0 | ||
provider: | ||
name: openfaas | ||
gateway: http://127.0.0.1:8080 | ||
functions: | ||
iotjs-express: | ||
lang: node | ||
handler: ./extra/tools/openfaas | ||
image: rzrfreefr/iotjs-express-openfaas:latest |