Created
October 18, 2015 15:05
-
-
Save oh-sky/3c881b4528a41d2a8cd4 to your computer and use it in GitHub Desktop.
aws-lambda-hello-pl
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
print "Hello world.\n" |
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
exports.handler = function(event, context) { | |
var exec = require('child_process').exec; | |
exec('perl hello.pl', function (error, stdout, stderr) { | |
if(stdout){ | |
console.log('stdout: ' + stdout); | |
} | |
if(stderr){ | |
console.log('stderr: ' + stderr); | |
} | |
if (error !== null) { | |
console.log('Exec error: ' + error); | |
} | |
context.succeed(stdout); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment