const admin = require('firebase-admin');
if (!admin.apps.length)
admin.initializeApp({
apiKey: "... your api key",
authDomain: "... your auth domain",
databaseURL: "... your database url",
projectId: "... your project id",
storageBucket: "... your storage bucket",
messagingSenderId: "... your messaging sender id"
});
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach Firebase",
"port": 9229,
"preLaunchTask": "Google Cloud Emulator"
}
]
}
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Start",
"type": "shell",
"command": "functions",
"isBackground": true,
"args": [
"start"
],
"group": "build"
},
{
"label": "Deploy",
"type": "shell",
"command": "functions",
"isBackground": true,
"options": {
"cwd": "${workspaceFolder}/functions/"
},
"args": [
"deploy",
"--trigger-http",
"--timeout",
"600s",
"api"
],
"dependsOn": [
"Start"
],
"group": "build"
},
{
"label": "Inspect",
"type": "shell",
"command": "functions",
"isBackground": true,
"options": {
"cwd": "${workspaceFolder}/functions/"
},
"args": [
"inspect",
"api"
],
"dependsOn": [
"Deploy"
],
"group": "build"
},
{
"label": "Google Cloud Emulator",
"dependsOn": [
"Inspect",
],
"group": "build"
},
]
}
- start debugging "Attach Firebase"