Skip to content

Instantly share code, notes, and snippets.

View michaeltrobinson's full-sized avatar

Michael Robinson michaeltrobinson

View GitHub Profile
@michaeltrobinson
michaeltrobinson / handler.js
Last active March 15, 2016 08:31 — forked from ThisIsMissEm/handler.js
The better way to execute Go on Amazon Lambda (see: http://blog.0x82.com/2014/11/24/aws-lambda-functions-in-go/)
var child_process = require('child_process');
exports.handler = function(event, context) {
var proc = child_process.spawn('./test', [ JSON.stringify(event) ], { stdio: 'inherit' });
proc.on('close', function(code){
if(code !== 0) {
return context.done(new Error("Process exited with non-zero status code"));
}