Configure serverless cli to setup and deploy node express API on AWS Lambda
Serverless CLI makes easy to create, deploy and monitor the application on the AWS Lambda. Can install serverless using npm in the local machine.
I will e creating a Node Express API endpoint using serverless and deploy it to AWS Lambda.
To configure serverless in the local machine globally
Once the serverless cli installed in local system, we can check if it is installed correctly by responding the version details.
Next we can create a project using serverless in the local machine, which later then can deploy to AWS lambda using serverless command.
The above command gives the below options to choose the the type of application that you want to create. Select the appropriate option ex:
Creating a new serverless project
Before doing further process, make sure you have an account in aws and active user with administrator permission.
To configure serverless in local machine with AWS , it require to set it with AWS user Key and Secret.
It will ask for the configuration in the next step once you started creating project using serverless command as above.
Refer Serverless Framework - AWS Credentials for setup.
Also in later stage we can setup Key and Secret using
Next , a copy of project template would be created, navigate to that directory and run
Above command will deploy the project which configured using serverless cli in local to AWS Lambda, and the endpoint would be exposed to run the API .
Now my all routes are available at
endpoint: ANY - https://rfzhaa489e.execute-api.us-east-1.amazonaws.com
Refer the Git hub for sample code reference.

0 Comments