@@ -96,11 +96,11 @@ export class AppModule {}
96
96
97
97
### Cloud Functions emulator
98
98
99
- Point callable Functions to the Cloud Function emulator by adding ` ORIGIN ` to the ` providers ` section of your ` NgModule ` .
99
+ Point callable Functions to the Cloud Function emulator by adding ` USE_EMULATOR ` to the ` providers ` section of your ` NgModule ` .
100
100
101
101
``` ts
102
102
import { NgModule } from ' @angular/core' ;
103
- import { AngularFireFunctionsModule , ORIGIN } from ' @angular/fire/functions' ;
103
+ import { AngularFireFunctionsModule , USE_EMULATOR } from ' @angular/fire/functions' ;
104
104
105
105
@NgModule ({
106
106
imports: [
@@ -110,7 +110,7 @@ import { AngularFireFunctionsModule, ORIGIN } from '@angular/fire/functions';
110
110
],
111
111
...
112
112
providers : [
113
- { provide: ORIGIN , useValue: ' http:// localhost:5001 ' }
113
+ { provide: USE_EMULATOR , useValue: [ ' localhost' , 5001 ] }
114
114
]
115
115
})
116
116
export class AppModule {}
@@ -127,11 +127,11 @@ To set this up, you first need to update your `hosting` section in `firebase.jso
127
127
"hosting" : {
128
128
"rewrites" : [
129
129
{
130
- "source" : " /project-name/us-central1/ someFunction" ,
130
+ "source" : " /someFunction" ,
131
131
"function" : " someFunction"
132
132
},
133
133
{
134
- "source" : " /project-name/us-central1/ anotherFunction" ,
134
+ "source" : " /anotherFunction" ,
135
135
"function" : " anotherFunction"
136
136
},
137
137
...
@@ -145,7 +145,7 @@ Next, configure functions origin to point at your app domain:
145
145
146
146
``` ts
147
147
import { NgModule } from ' @angular/core' ;
148
- import { AngularFireFunctionsModule , ORIGIN } from ' @angular/fire/functions' ;
148
+ import { AngularFireFunctionsModule , ORIGIN , NEW_ORIGIN_BEHAVIOR } from ' @angular/fire/functions' ;
149
149
150
150
@NgModule ({
151
151
imports: [
@@ -155,6 +155,7 @@ import { AngularFireFunctionsModule, ORIGIN } from '@angular/fire/functions';
155
155
],
156
156
...
157
157
providers : [
158
+ { provide: NEW_ORIGIN_BEHAVIOR , useValue: true },
158
159
{ provide: ORIGIN , useValue: ' https://project-name.web.app' }
159
160
]
160
161
})
0 commit comments