Skip to content

Instantly share code, notes, and snippets.

@sgr-ksmt
Created April 4, 2020 07:27
Show Gist options
  • Save sgr-ksmt/993719e251dcc559177f649656fbed6c to your computer and use it in GitHub Desktop.
Save sgr-ksmt/993719e251dcc559177f649656fbed6c to your computer and use it in GitHub Desktop.
Wrap firebase-functions with specified region.
import * as f from 'firebase-functions'
const functions = (runtimeOptions: f.RuntimeOptions = {}) =>
f.runWith(runtimeOptions).region('asia-northeast1')
export default functions
import functions from '../util/baseFunctions'
export const onCreate = functions({ memory: '512MB' })
.firestore.document('/users/{userID}')
.onCreate(async (snapshot, context) => {
//...
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment