小编Ben*_*aki的帖子

使用Cloud Functions for Firebase和@ google-cloud/storage删除图像时出现问题

我正在尝试在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

9
推荐指数
2
解决办法
1489
查看次数

如何在jenkins中使用xunit(.net核心)测试结果?

我有一个asp.net核心应用程序,其中有一些用XUnit编写的测试。如何通过詹金斯(Jenkins)等工具使用测试结果?

c# xunit jenkins .net-core

4
推荐指数
1
解决办法
2190
查看次数

在angularjs指令中对原始变量进行双向绑定

尝试在使用原始对象时对AngularJS指令进行双向绑定不起作用,例如:

<custom-directive ng-model="variable"></custom-directive>
Run Code Online (Sandbox Code Playgroud)

怎么能实现呢?

angularjs angularjs-directive

3
推荐指数
1
解决办法
2680
查看次数