Skip to content

Instantly share code, notes, and snippets.

@lukas-h
Last active April 8, 2018 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukas-h/fe1f34d201a464d4235d8875bb017d1b to your computer and use it in GitHub Desktop.
Save lukas-h/fe1f34d201a464d4235d8875bb017d1b to your computer and use it in GitHub Desktop.
targets:
$default:
sources:
- "node/**"
- "lib/**"
builders:
build_node_compilers|entrypoint:
generate_for:
- node/**
options:
compiler: dart2js
# List any dart2js specific args here, or omit it.
dart2js_args:
- --checked
import 'package:firebase_functions_interop/firebase_functions_interop.dart';
import 'package:node_io/node_io.dart';
import 'dart:convert';
void main() {
functions['helloWorld'] =
FirebaseFunctions.https.onRequest(helloWorld);
}
void helloWorld(ExpressHttpRequest request) {
request.response
..headers.contentType = ContentType.JSON
..write(json.encode({'key' : 'hello from dart'}))
..close();
}
mkdir project
cd project
firebase init functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment