Skip to content

This is my default template when I want to start a new project using the Serverless Framework.

Notifications You must be signed in to change notification settings

Ajeo/serverless-framework-custom-template

Repository files navigation

Serverless Framework Custom Template

This is my default template when I want to start a new project using the Serverless Framework.

Usage

Install this dependencies:

  1. NVM
  2. Node v16.16.0: nvm install v16.16.0
  3. Use Node v16.16.0: nvm use 16.16.0
  4. Serverless Framework: npm install -g serverless
  5. Run npm install: npm i

Deployment

In order to deploy the example, you need to run the following command:

$ serverless deploy

After running deploy, you should see output similar to:

Deploying aws-node-project to stage dev (us-east-1)

✔ Service deployed to stack aws-node-project-dev (112s)

functions:
  hello: aws-node-project-dev-hello (1.5 kB)

Invocation

After successful deployment, you can invoke the deployed function by using the following command:

serverless invoke --function hello

Which should result in response similar to the following:

{
  "statusCode": 200,
  "body": "{\n  \"message\": \"Go Serverless v3.0! Your function executed successfully!\",\n  \"input\": {}\n}"
}

Local development

You can invoke your function locally by using the following command:

serverless invoke local --function hello

Which should result in response similar to the following:

{
    "statusCode": 200,
    "body": "{\n  \"message\": \"Go Serverless v3.0! Your function executed successfully!\",\n  \"input\": \"\"\n}"
}

About

This is my default template when I want to start a new project using the Serverless Framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published