簡體   English   中英

如何將我的 Firebase 功能部署到特定區域?

[英]How do I deploy my firebase functions into a specific region?

const functions = require('firebase-functions')
const admin = require('firebase-admin')
admin.initializeApp()

exports.sendChatMsgNotification = functions.region('europe-west1')
firestore
  .document('chats/{idChat}/messages/{idMessage}')
  .onCreate((snap, context) => {
    console.log('----------------start function--------------------')

我正在嘗試將我的 Firebase 雲功能部署到 europe-west1 區域,因為默認值為 us-central1,但我總是遇到錯誤。

是的,我已經嘗試遵循官方文檔https://firebase.google.com/docs/functions/locations#android 我只是不知道如何正確應用它。 我已經試過很多次了。

如果有人可以告訴我如何使用我上面的代碼應用正確的方法,將不勝感激!

exports.sendChatMsgNotification = functions.region('europe-west1')
firestore

(工作)之后

exports.sendChatMsgNotification = functions.region('europe-west1').
firestore

在“firestore”之前,我只漏掉了一個點 (.)。 感謝@Jason Berryman 指出!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM