$ sls deploy
After successful deployment, you can invoke the deployed function by using the following command:
sls invoke --function health
Which should result in response similar to the following:
{
"statusCode": 200,
"body": "{\"message\": \"ok\"}"
}
You can invoke your function locally by using the following command:
sls invoke local --function health
Which should result in response similar to the following:
{
"statusCode": 200,
"body": "{\"message\": \"ok\"}"
}
Check out the Serverless Framework docs for more information.