Infrastructure as a Service
Function as a Service
Servers are completely abstracted from the developer
The billing is based on the consumption and executions of functions, not server instance
Event-driven and instantaneously scalable
AWS Lambda
Google Cloud Functions
OpenWhisk
OpenFaas
sudo npm install serverless -gmkdir serverless
cd serverless
serverless create -t aws-nodejsserverless config credentials --provider aws --key <your-aws-key> --secret <your-aws-secret>// handler.js
'use strict';
module.exports.hello = async (event, context) => {
return {
statusCode: 200,
body: JSON.stringify({
message: 'Hello World!',
input: event,
}),
};
};serverless deploy