?
Credit to Mike Roberts
http://martinfowler.com/articles/serverless.html
AWS Lambda lets you run code without provisioning or managing servers. You pay only for the compute time you consume - there is no charge when your code is not running. With Lambda, you can run code for virtually any type of application or backend service - all with zero administration. Just upload your code and Lambda takes care of everything required to run and scale your code with high availability. You can set up your code to automatically trigger from other AWS services or call it directly from any web or mobile app.
(using apex)
module.exports.hello = (event, context, callback) => {
return callback(null, "Hello lambda");
};module.exports.hello = (event, context, callback) => {
return callback(null, JSON.stringify({
message: "Hello lambda"
}));
};module.exports.hello = (event, context, callback) => {
return callback(null, "Hello " + event.name);
};module.exports.hello = (event, context, callback) => {
if (event.company != "NewStore") {
return callback(
"You're working for the wrong company",
null
);
}
return callback(null, "You made a good choice!");
};module.exports.hello = (event, context, callback) => {
// giving an error here would lead
// to a 500 response code
return callback(
null,
{
statusCode: 200,
body: JSON.stringify({
message: "Hello Lambda"
})
}
);
};