ブックマーク / sunday-morning.app (1)

  • Firebase Functionsを呼び出す際にregion指定するとEmulatorではなく本番に接続してしまう

    Function定義Firebase Functionsのリージョンはデフォルトでは us-central1 になっている。 Function定義時にregionを指定するとリージョン変更ができる。 例えば東京リージョンに切り替えたい場合は↓のように asia-northeast1 を指定する。 const someFunction = functions.region("asia-northeast1").https.onCall(async (data, context) => { return { message: "ok" } }これでFunctionをデプロイすると東京リージョンに公開される。 Function呼び出し元client側では↓のようにfunctionsの引数にregionを指定することで呼び出すregionを変更できる。 const functions = fire

    Firebase Functionsを呼び出す際にregion指定するとEmulatorではなく本番に接続してしまう
    t_f_m
    t_f_m 2021/12/14
  • 1