A β‘ Serverless framework β‘ plugin for Dart applications
Install the plugin inside your serverless project with npm.
$ npm i -D serverless-dartπ‘ The -D flag adds it to your development dependencies in npm speak
π‘ This plugin assumes you are using Dart Runtime for AWS Lambda coding your applications.
Add the following to your serverless project's serverless.yml file
service: hello
provider:
name: aws
runtime: dart
plugins:
# this registers the plugin
# with serverless
- serverless-dart
# creates one artifact for each function
package:
individually: true
functions:
hello:
# the first part of the handler refers to the script lib/main.dart.
# main.hello identifies the handler to execute in the Dart runtime.
# The runtime supports multiple handlers
# The plugin is smart to not rebuild those scripts with multiple handlers.
handler: main.hello
events:
- http:
path: /hello
method: GETπ‘ The Dart Runtime for AWS Lambda requires a binary named
bootstrap. This plugin renames the binary that is generated tobootstrapfor you and zips that file.
The default behavior is to build your Lambda inside a Docker container. Make sure you get Docker.
Every serverless workflow command should work out of the box.
$ npx serverless deploy$ npx serverless deployClone the repository
$ git clone https://github.com/katallaxie/serverless-dartLink the package
$ npm linkLink the package to your testing environment
$ npm link serverless-dartWe π Dart.