Giter Site home page Giter Site logo

myconsciousness / aws-lambda-dart-runtime-ns Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 40 KB

A powerful runtime to build Lambda functions in Dart with native AWS events. Sound null safety.

Home Page: https://pub.dev/packages/aws_lambda_dart_runtime_ns

License: Apache License 2.0

Dart 100.00%
aws aws-lambda aws-lambda-runtime aws-lambda-dart

aws-lambda-dart-runtime-ns's Introduction

Dart Runtime for AWS Lambda (Sound Null Safety)

A ๐ŸŽฏ Dart Runtime for ฦ› AWS Lambda


This package is based on the official aws-lambda-dart-runtime. It is a restructured version of the outdated official aws-lambda-dart-runtime adapted to the latest Dart SDK to make it easier to maintain.

Thanks to katallaxie and AWS Labs involved in the development of the original stuff!

You can read the official document too!


Features

Read Introducing a Dart runtime for AWS Lambda

  • Great performance < 10ms on event processing and < 50MB memory consumption
  • No need to ship the Dart runtime
  • Multiple event handlers
  • Support for serverless framework

๐Ÿ“ฆ Install

You can easily add this package to your app.

dart pub add aws_lambda_dart_runtime_ns
dart pub get

ฦ› Use

import 'package:aws_lambda_dart_runtime_ns/aws_lambda_dart_runtime_ns.dart';

Future<void> main() async => await invokeAwsLambdaRuntime([
      _sayHelloWorldFunction,
      _doSomethingFunction,
    ]);

/// GET endpoint that just returns "Hello, World!".
FunctionHandler get _sayHelloWorldFunction => FunctionHandler(
      name: 'main.helloWorld',
      action: (context, event) {
        return InvocationResult(
          requestId: context.requestId,
          body: {
            'message': 'Hello, World!',
          },
        );
      },
    );

/// POST endpoint does something.
FunctionHandler get _doSomethingFunction => FunctionHandler(
      name: 'main.doSomething',
      action: (context, event) {
        // Do something here...

        return InvocationResult(requestId: context.requestId);
      },
    );

License

Apache 2.0

We ๐Ÿ’™ Dart.

aws-lambda-dart-runtime-ns's People

Contributors

myconsciousness avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

henryqum

aws-lambda-dart-runtime-ns's Issues

"errorType": "InvocationError", "Null check operator used on a null value",

Hi,

i came across your package and i want to thank you for your work

i deployed a function and i got the following error

NewEve

Response
{
  "errorType": "InvocationError",
  "errorMessage": "Null check operator used on a null value",
  "stackTrace": "#0      new RuntimeContext.fromNextInvocation (package:aws_lambda_dart_runtime_ns/src/runtime/context.dart:56)\n#1      AwsLambdaRuntime.invoke (package:aws_lambda_dart_runtime_ns/src/runtime/runtime.dart:59)\n<asynchronous suspension>\n#2      invokeAwsLambdaRuntime (package:aws_lambda_dart_runtime_ns/src/runtime/runtime.dart:20)\n<asynchronous suspension>\n#3      main (file:///root/node-zfs-test/qcp_storage_qs_proc/bin/main.dart:3)\n<asynchronous suspension>\n"
}```

aws have a problem with this line `executionEnv: Platform.environment[_kAWSLambdaExecutionEnv]!` i guess this var not in the env for some reason maybe it's an optional var

thanks for you help

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.