Rename 'function-run' dir to 'environments'

This commit is contained in:
Soam Vasani
2016-11-02 11:22:20 -07:00
parent 0805e5911d
commit bfdd706b98
8 changed files with 0 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
module.exports = function (context, callback) {
console.log("headers=", JSON.stringify(context.request.headers));
console.log("body=", JSON.stringify(context.request.body));
callback(200, "Hello, world !\n");
}
+31
View File
@@ -0,0 +1,31 @@
#!/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 &
function cleanup() {
echo "-- Cleanup"
kill %1
}
trap cleanup EXIT
sleep 2
echo "-- Specializing"
curl -f -X POST http://localhost:8888/specialize
echo "-- Running user function"
curl -f -X GET http://localhost:8888
curl -f -X POST http://localhost:8888
curl -f -X PUT http://localhost:8888
curl -f -X DELETE http://localhost:8888
curl -f -X TRACE http://localhost:8888
curl -f -X OPTIONS http://localhost:8888
# -I causes curl to make a HEAD request.
curl -f -I http://localhost:8888