npm install -g serverlessto install it.
Create a new service using the Node.js template, specifying a unique name and an optional path for your service.
# Create a new Serverless Service/Project $ serverless create --template spotinst-nodejs -p new-service # Change into the newly created directory $ cd new-service
Use this when you have made changes to your Functions, Events or Resources in
serverless.yml or you simply want to deploy all changes within your Service at the same time.
serverless deploy -v
Use this to quickly upload and overwrite your function code, allowing you to develop faster.
serverless deploy function -f hello
Invokes a Function
serverless invoke -f hello
Open up a separate tab in your console and stream all logs for a specific Function using this command.
serverless logs -f hello -t
If at any point, you no longer need your service, you can run the following command to remove the Functions, Events and Resources that were created, and ensure that you don't incur any unexpected charges.