firebase deploy to custom region (eu-central1)

前端 未结 5 1468
心在旅途
心在旅途 2020-12-08 06:43

is there a way to specify the Region/Zone where my firebase functions will be deployed.

Actually i didn\'t found anything about that in the documentation and my fun

5条回答
  •  庸人自扰
    2020-12-08 07:16

    From docs: https://firebase.google.com/docs/functions/locations

    Now available in the following regions:

    • us-central1 (Iowa)
    • us-east1 (South Carolina)
    • europe-west1 (Belgium)
    • asia-northeast1 (Tokyo)

    Best Practices for Changing Region

    // before
    const functions = require('firebase-functions');
    
    exports.webhook = functions
        .https.onRequest((req, res) => {
                res.send("Hello");
        });
    
    // after
    const functions = require('firebase-functions');
    
    exports.webhookEurope = functions
        .region('europe-west1')
        .https.onRequest((req, res) => {
                res.send("Hello");
        });
    

提交回复
热议问题