firebase deploy to custom region (eu-central1)

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");
    });

firebaser here

Update (2018-07-25):

It is now possible to specify the region for your Cloud Functions in Firebase you specify that region in your code and deploy the change. E.g.:

exports.myStorageFunction = functions
    .region('europe-west1')
    .storage
    .object()
    .onFinalize((object) => {
      // ...
    });

For full details see the Firebase documentation on Cloud Functions locations (from where I got the above snippet) and modifying the region of a deployed function.