aws_lambda_dart_runtime 1.0.3 copy "aws_lambda_dart_runtime: ^1.0.3" to clipboard
aws_lambda_dart_runtime: ^1.0.3 copied to clipboard

outdated

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

example/lib/main.dart

import 'package:aws_lambda_dart_runtime/aws_lambda_dart_runtime.dart';

void main() async {
  /// This demo's handling an API Gateway request.
  final Handler<AwsApiGatewayEvent> helloApiGateway = (context, event) async {
    final response = {"message": "hello ${context.requestId}"};

    /// it returns an encoded response to the gateway
    return InvocationResult(
        context.requestId, AwsApiGatewayResponse.fromJson(response));
  };

  /// The Runtime is a singleton. You can define the handlers as you wish.
  Runtime()
    ..registerHandler<AwsApiGatewayEvent>("hello.apigateway", helloApiGateway)
    ..invoke();
}
25
likes
0
pub points
71%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (LICENSE)

Dependencies

json_annotation

More

Packages that depend on aws_lambda_dart_runtime