aws_lambda_runtime 1.1.1 copy "aws_lambda_runtime: ^1.1.1" to clipboard
aws_lambda_runtime: ^1.1.1 copied to clipboard

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

example/lib/main.dart

import 'package:aws_lambda_runtime/aws_lambda_runtime.dart';
import 'package:aws_lambda_runtime/runtime/context.dart';

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

    /// it returns an response to the gateway
    return AwsApiGatewayResponse.fromJson(response);
  };

  /// The Runtime is a singleton. You can define the handlers as you wish.
  Runtime()
    ..registerHandler<AwsApiGatewayEvent>('hello.apigateway', helloApiGateway)
    ..invoke();
}
0
likes
130
points
56
downloads

Publisher

unverified uploader

Weekly Downloads

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

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

http, json_annotation, meta

More

Packages that depend on aws_lambda_runtime