Last active
April 8, 2018 20:55
-
-
Save lukas-h/fe1f34d201a464d4235d8875bb017d1b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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