Code Monkey home page Code Monkey logo

serverless-dart's Introduction

โšก ๐ŸŽฏ

serverless-dart

A โšก Serverless framework โšก plugin for Dart applications


๐Ÿ“ฆ Install

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 to bootstrap for you and zips that file.

The default behavior is to build your Lambda inside a Docker container. Make sure you get Docker.

๐Ÿคธ Usage

Every serverless workflow command should work out of the box.

package your Lambdas

$ npx serverless deploy

deploy your Lambdas

$ npx serverless deploy

๐Ÿ‘จโ€๐Ÿ’ป Development

Clone the repository

$ git clone https://github.com/katallaxie/serverless-dart

Link the package

$ npm link

Link the package to your testing environment

$ npm link serverless-dart

๐Ÿ“ƒ License

Apache 2.0

We ๐Ÿ’™ Dart.

serverless-dart's People

Contributors

katallaxie avatar amondnet avatar

Stargazers

Andrii Syrokomskyi avatar Enzo Danjour avatar Samuel Chan avatar Francisco Pitriqueo avatar  avatar Dino Leung avatar Nima Karimi avatar Donald Wu avatar naoya_s avatar Andres Garcia avatar Kuringa (Ghost) avatar Sam Moore avatar Marcelo Henrique Neppel avatar Zahid Shaikh avatar Andrei Lesnitsky avatar David Araujo avatar Brent Parker avatar  avatar  avatar Vince Varga avatar  avatar Nguyแป…n Viแป‡t Dลฉng avatar  avatar ANA avatar zakariaBoukernafa avatar Marcos Fonseca avatar PatrickJS avatar Michael Charles Aubrey avatar Sacha Arbonel avatar

Watchers

 avatar James Cloos avatar Michael Charles Aubrey avatar Marcos Fonseca avatar  avatar

serverless-dart's Issues

serverless-dart offline

Is it possible to run serverless-dart in the local environment, for example using serverless-offline?

๐Ÿ’ก Feature description

Run serverless-dart with serverless-offline to run and test code locally.

Unable to invoke functions offline, results in "bootstrap: permission denied" error.

๐Ÿ› Bug description

When attempting to invoke a function offline by using DEBUG_SLS=* sls invoke local -f hello -vvv, the following error occurs.

{"errorType":"exitError","errorMessage":"RequestId: 3f59fa65-eb97-1e5b-a6fa-b4e87afe4fe9 Error: fork/exec /var/task/bootstrap: permission denied"}

๐Ÿค” Expected Behavior

The function should invoke offline.

๐Ÿ‘Ÿ Steps to reproduce

Use the serverless-aws-dart template to begin a project, and then attempt to invoke a function offline (DEBUG_SLS=* sls invoke local -f hello -vvv).

๐ŸŒ Your environment

MacOS Big Sur 11.1
node v14.2.0
serverless: Framework Core: 2.16.1 Plugin: 4.3.0 SDK: 2.3.2 Components: 3.4.3

serverless deploy not working anymore

๐Ÿ› Bug description

serverless deploy is not working, since dart replaced dart2native with dart compile exe

sh: 1: /usr/lib/dart/bin/dart2native: not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.