[英]Firebase functions:config:set silently discarding values?
剛試過這個:
firebase functions:config:set firebase.webapikey="XXXXX"
Error: Cannot set to reserved namespace firebase
錯誤很明顯。 所以我試過這個:
firebase functions:config:set firebaseapis.web="XXXX"
✔ Functions config updated.
Please deploy your functions for the change to take effect by running firebase deploy --only functions
很好,沒有錯誤。 然而:
carlos@carlos-linux-dev:~/firestore_experiments$ firebase functions:config:get |grep firebase
carlos@carlos-linux-dev:~/firestore_experiments$
因此該密鑰實際上並未存儲。 但是,如果將其更改為其他內容:
dev:~/firestore_experiments$firebase functions:config:set pithole.web="XXXX"
✔ Functions config updated.
Please deploy your functions for the change to take effect by running firebase deploy --only functions
carlos@carlos-linux-dev:~/firestore_experiments$ firebase functions:config:get |grep pithole
"pithole": {
我在文檔中找不到任何關於此的參考,似乎是一個錯誤......這實際上是預期的行為嗎?
更重要的是,Web API 是否可以自動用於 Firebase 項目 oo 它確實需要從控制台復制/粘貼嗎?
有一個內部錯誤會阻止以字符串“firebase”開頭的配置參數名稱無法正常工作,就像您在第二個示例中所做的那樣不起作用。 (firebaseapi.web 仍然以“firebase”開頭)。 以任何其他 8 個字符開頭,您應該沒問題。
更重要的是,Web API 是否可自動用於 Firebase 項目,還是確實需要從控制台復制/粘貼?
我一直在尋找一種方法來實現這一目標,但迄今為止沒有成功。
process.env.FIREBASE_CONFIG
有一個可用於雲函數的環境變量,但它不包含 API 密鑰,僅包含以下屬性:
{
"projectId":"[project-name]",
"databaseURL":"https://[project-name].firebaseio.com",
"storageBucket":"[project-name].appspot.com",
"locationId":"europe-west"
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.