Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add import/export support to Realtime Database #2429

Merged
merged 11 commits into from
Jul 7, 2020
Prev Previous commit
Next Next commit
Last try
  • Loading branch information
samtstern committed Jul 7, 2020
commit 52b4bc7bad248794345dc61ea0ee0c97a89203a9
5 changes: 3 additions & 2 deletions src/emulator/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,13 @@ export async function startAll(options: any, noUi: boolean = false): Promise<voi

const readStream = fs.createReadStream(fPath);

const importUrl = `http:https://${databaseAddr.host}:${databaseAddr.port}/.json?ns=${ns}&disableTriggers=true&writeSizeLimit=unlimited`;
await new Promise((resolve, reject) => {
const req = http.request(
importUrl,
{
method: "PUT",
host: databaseAddr.host,
port: databaseAddr.port,
path: `/.json?ns=${ns}&disableTriggers=true&writeSizeLimit=unlimited`,
headers: {
Authorization: "Bearer owner",
"Content-Type": "application/json",
Expand Down