Skip to content

Commit 6be0b31

Browse files
committed
src: bump to [email protected]
1 parent 19b80c4 commit 6be0b31

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

run-test.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,12 @@ docker run --rm --cidfile ${CID_FILE} -a stdout -a stderr -v $(pwd)/test:/home/n
105105

106106
echo "Giving it a few seconds to initialize..."
107107
wait_for_cid
108-
wait_for_file "package-lock.json"
108+
wait_for_file "test/package-lock.json"
109109

110110
test_http
111111
test_events
112-
test_probe "/health"
112+
test_probe "/health/readiness"
113+
test_probe "/health/liveness"
113114

114115
echo "Test success. Cleaning up..."
115116
cleanup

src/index.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
const path = require('path');
44
const framework = require('@redhat/faas-js-runtime');
5+
const userFunction = require(path.join(`${__dirname},`, '..', 'usr'));
56

6-
console.log(`Executing in ${__dirname}`);
7+
const http = require('http');
78

8-
framework(require(path.join(`${__dirname}`, '..', 'usr')), 8080, server => {
9-
console.log('FaaS framework initialized.');
9+
framework(userFunction, 8080, server => {
10+
console.log('FaaS framework initialized');
1011
});

src/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "js-runtime",
33
"version": "1.0.0",
44
"dependencies": {
5-
"@redhat/faas-js-runtime": "0.0.2",
5+
"@redhat/faas-js-runtime": "0.0.4",
66
"cloudevents-sdk": "v0.3.1",
77
"overload-protection": "^1.1.0"
88
}

test/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
const isNumber = require('is-number')
66

77
module.exports = context => {
8-
const ret = 'This is the test function for Node.js FaaS. Success.';
8+
const ret = { message: 'This is the test function for Node.js FaaS. Success.'};
99
if (isNumber(ret)) throw new Error('Something is wrong with modules');
10-
if (context.cloudevent) return context.cloudevent.data.message;
10+
if (context.cloudevent) return { message: context.cloudevent.data.message };
1111
return ret;
1212
};

0 commit comments

Comments
 (0)