yarn serverless 0.1.4
v0.1.4

latest releases: 3.38.0-d09dc659, 3.38.0-21757898, 3.38.0-9117ee93...
8 years ago

V0.1.4

Updates

Templates

You can now add s-templates.json files to the root of your Project, Components, Modules and Functions. Even better, you can inherit templates from parent level template files and extend them in sub-template files. For example:

// project/s-templates.json
{
  "apiRequestTemplate": {
    "application/json": {
      "httpMethod": "$context.httpMethod"
    }
  }
}

// project/component/module/functions-template.json
{
  "apiRequestTemplate": {
    "application/json": {
      "pathId": "$input.params('id')"
    }
  }
}

// This will populate the function endpoint's request template with the merged template:
{
  "apiRequestTemplate": {
    "application/json": {
      "httpMethod": "$context.httpMethod",
      "pathId": "$input.params('id')"
    }
  }
}

You can use templates in an s-.json files and they will inherit/extend themselves intelligently. The Serverless-Starter project has been updated to show examples of useful template inheritance.

More Class Methods

Many classes now have additional methods which you can call to get their parent assets. For example, ServerlessFunction has:

.getModule()
.getComponent()
.getProject()

Bug Fixes

Template Inheritance Bug

In v0.1.3 templates do not inherit subjectively by the assets that were calling them.

Don't miss a new serverless release

NewReleases is sending notifications on new releases.