LoginSignup
2
0

More than 3 years have passed since last update.

firebase functionsの諸々の設定方法

Posted at

備忘録

リージョンの設定方法

functionsのregionを使用する

functions.region('asia-northeast1')

スペックの指定方法

functionsのrunWithでmemoryを設定する
Cloud Functions の料金にメモリ、CPU、料金の対応表がある

functions.runWith({ memory: '2GB' })

クライアントSDKから直接Cloud Functions for Firebaseを呼び出す場合の指定方法

cloud functions側ではonCallを使う

export const func = functions.https.onCall((data, context) => {
  console.log(data.hoge) // クライアント側が下記の記述の場合にはhoge
})

クライアント側はhttpsCallableを使う

const func = firebase
    .app()
    .functions('asia-northeast1')
    .httpsCallable('func')

await func({ hoge: 'hoge' })
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0