上QQ阅读APP看书,第一时间看更新
Invoking locally
Pushing the code to AWS Lambda and testing every time would be expensive and time consuming. So with Serverless Framework, we can invoke or test functions locally and then deploy them to the cloud. We can have this as part of the continuous deployment pipeline, where we can set the local invocation for dev stage deployment, set up automated testing, and then move them further down the pipeline to deploy and test remotely. The following command is used to invoke the function locally:
$ serverless invoke local --function hello
{
"statusCode": 200,
"body": "{\"message\":\"My Serverless World\",\"input\":\"\"}"
}