我正在尝试在Cloud Functions for Firebase中创建一个脚本,该脚本将对db事件做出反应并删除在其中一个参数("fullPath")中具有路径的图像.
这是我正在使用的代码:
'use strict';
const functions = require('firebase-functions');
const request = require('request-promise');
const admin = require('firebase-admin');
const gcs = require('@google-cloud/storage')({
projectId: 'XXXXXXX',
credentials: {
// removed actual credentials from here
}});
admin.initializeApp(functions.config().firebase);
// Deletes the user data in the Realtime Datastore when the accounts are deleted.
exports.removeImageOnNodeRemoval = functions.database
.ref("images/{imageId}")
.onWrite(function (event) {
// exit if we are creating a new record (when no previous data exists)
if (!event.data.previous.exists()) {
console.log("a new image added");
return;
}
// …Run Code Online (Sandbox Code Playgroud) node.js google-cloud-storage firebase google-cloud-platform firebase-storage
我有一个asp.net核心应用程序,其中有一些用XUnit编写的测试。如何通过詹金斯(Jenkins)等工具使用测试结果?
尝试在使用原始对象时对AngularJS指令进行双向绑定不起作用,例如:
<custom-directive ng-model="variable"></custom-directive>
Run Code Online (Sandbox Code Playgroud)
怎么能实现呢?