Skip to content

Commit

Permalink
Merge 39b1d3a into 589387b
Browse files Browse the repository at this point in the history
  • Loading branch information
jmwski committed Jun 18, 2019
2 parents 589387b + 39b1d3a commit 6beca7e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/emulator/constants.ts
Expand Up @@ -14,6 +14,7 @@ const DEFAULT_HOST = "localhost";
export class Constants {
static SERVICE_FIRESTORE = "firestore.googleapis.com";
static SERVICE_REALTIME_DATABASE = "firebaseio.com";
static DEFAULT_DATABASE_EMULATOR_NAMESPACE = "fake-server";

static getDefaultHost(emulator: Emulators): string {
return DEFAULT_HOST;
Expand Down
13 changes: 12 additions & 1 deletion src/emulator/functionsEmulator.ts
Expand Up @@ -588,8 +588,19 @@ You can probably fix this by running "npm install ${
);
logger.debug(`addDatabaseTrigger`, JSON.stringify(bundle));
return new Promise((resolve, reject) => {
let setTriggersPath = `http://localhost:${databasePort}/.settings/functionTriggers.json`;
if (projectId !== "") {
setTriggersPath += `?ns=${projectId}`;
} else {
EmulatorLogger.log(
"WARN",
`No project in use. Registering function trigger for sentinel namespace '${
Constants.DEFAULT_DATABASE_EMULATOR_NAMESPACE
}'`
);
}
request.put(
`http://localhost:${databasePort}/.settings/functionTriggers.json`,
setTriggersPath,
{
auth: {
bearer: "owner",
Expand Down

0 comments on commit 6beca7e

Please sign in to comment.