functions_framework 0.3.1
functions_framework: ^0.3.1 copied to clipboard

Dart native
Flutter Android iOS

FaaS (Function as a service) framework for writing portable Dart functions

Functions Framework for Dart #

DISCLAIMER: this is not ready for production.

Functions FrameworkUnit TestsLint TestConformance Tests
Dart

An open source FaaS (Function as a Service) framework for writing portable Dart functions, brought to you by the Google Dart and Cloud Functions teams.

The Functions Framework lets you write lightweight functions that run in many different environments, including:

The framework allows you to go from:

import 'package:functions_framework/functions_framework.dart';
import 'package:shelf/shelf.dart';

@CloudFunction()
Response handleGet(Request request) => Response.ok('Hello, World!');

To:

curl http://my-url
# Output: Hello, World!

All without needing to worry about writing an HTTP server or request handling logic.

Features #

  • Build your Function in the same container environment used by Cloud Functions using buildpacks.
  • Invoke a function in response to a request
  • Automatically unmarshal events conforming to the CloudEvents spec
  • Portable between serverless platforms

Quickstart: Hello, World on your local machine #

$ docker build -t app .
...

$ docker run -it -p 8080:8080 --name demo app
App listening on :8080

In another terminal...

$ curl localhost:8080
Hello, World!

Contributing changes #

See CONTRIBUTING.md for details on how to contribute to this project, including how to build and test your changes as well as how to properly format your code.

Licensing #

BSD 3-Clause License. See LICENSE for details.

16
likes
80
pub points
66%
popularity

Publisher

cloud.google.com

FaaS (Function as a service) framework for writing portable Dart functions

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache 2.0 (LICENSE)

Dependencies

args, http, http_parser, io, json_annotation, meta, shelf, stack_trace

More

Packages that depend on functions_framework