File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,18 @@ const DATABASE_ADDRESS_DEFAULT: string = 'localhost:9000';
4343const DATABASE_ADDRESS : string =
4444 process . env [ DATABASE_ADDRESS_ENV ] || DATABASE_ADDRESS_DEFAULT ;
4545
46- /** If this environment variable is set, use it for the Firestore emulator. */
47- const FIRESTORE_ADDRESS_ENV : string = 'FIREBASE_FIRESTORE_EMULATOR_ADDRESS' ;
46+ /** If any of environment variable is set, use it for the Firestore emulator. */
47+ const FIRESTORE_ADDRESS_ENVS : string [ ] = [
48+ 'FIRESTORE_EMULATOR_HOST' ,
49+ 'FIREBASE_FIRESTORE_EMULATOR_ADDRESS'
50+ ] ;
4851/** The default address for the local Firestore emulator. */
4952const FIRESTORE_ADDRESS_DEFAULT : string = 'localhost:8080' ;
5053/** The actual address for the Firestore emulator */
51- const FIRESTORE_ADDRESS : string =
52- process . env [ FIRESTORE_ADDRESS_ENV ] || FIRESTORE_ADDRESS_DEFAULT ;
54+ const FIRESTORE_ADDRESS : string = FIRESTORE_ADDRESS_ENVS . reduce (
55+ ( addr , name ) => process . env [ name ] || addr ,
56+ FIRESTORE_ADDRESS_DEFAULT
57+ ) ;
5358
5459/** Passing this in tells the emulator to treat you as an admin. */
5560const ADMIN_TOKEN = 'owner' ;
You can’t perform that action at this time.
0 commit comments