diff --git a/src/function-run/nodejs/test/test.js b/src/function-run/nodejs/test/test.js new file mode 100644 index 00000000..d3e16c38 --- /dev/null +++ b/src/function-run/nodejs/test/test.js @@ -0,0 +1,4 @@ +exports = function (context, callback) { + console.log("Test function"); + callback(200, "Hello, world!"); +} diff --git a/src/function-run/nodejs/test/test.sh b/src/function-run/nodejs/test/test.sh new file mode 100755 index 00000000..8ab05116 --- /dev/null +++ b/src/function-run/nodejs/test/test.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +# TODO placeholder until we have better tests :) + +set +x +set -e + +DIR=$(dirname $0) + +echo "-- Starting server" +node $DIR/../server.js --codepath $DIR/test.js --port 8888 & +sleep 2 + +echo "-- Specializing" +curl -f -X POST http://localhost:8888/specialize + +echo "-- Running user function" +curl -f http://localhost:8888 ; echo + +echo "-- Cleanup" +kill %1 +