mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-02-20 07:44:01 -05:00
Fix firebase emulator for storage
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
"auth": {
|
||||
"port": 9099
|
||||
},
|
||||
"storage": {
|
||||
"port": 9199,
|
||||
"host": "127.0.0.1"
|
||||
},
|
||||
"ui": {
|
||||
"enabled": true,
|
||||
"port": 4000
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
import { getStorage } from 'firebase/storage'
|
||||
import { getApp, getApps, initializeApp } from 'firebase/app'
|
||||
import { FIREBASE_CONFIG } from 'common/envs/constants'
|
||||
import {connectStorageEmulator, getStorage} from 'firebase/storage'
|
||||
import {getApp, getApps, initializeApp} from 'firebase/app'
|
||||
import {FIREBASE_CONFIG, IS_FIREBASE_EMULATOR} from 'common/envs/constants'
|
||||
|
||||
// Initialize Firebase
|
||||
export const app = getApps().length ? getApp() : initializeApp(FIREBASE_CONFIG)
|
||||
|
||||
// Initialize storage with emulator support
|
||||
export const storage = getStorage()
|
||||
export const privateStorage = getStorage(
|
||||
app,
|
||||
'gs://' + FIREBASE_CONFIG.privateBucket
|
||||
)
|
||||
|
||||
// Connect to storage emulator if in emulator mode
|
||||
if (IS_FIREBASE_EMULATOR) {
|
||||
connectStorageEmulator(storage, '127.0.0.1', 9199)
|
||||
connectStorageEmulator(privateStorage, '127.0.0.1', 9199)
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ module.exports = {
|
||||
{hostname: '*.giphy.com'},
|
||||
{hostname: 'ui-avatars.com'},
|
||||
{hostname: 'localhost'},
|
||||
{hostname: '127.0.0.1'},
|
||||
],
|
||||
},
|
||||
webpack: (config, {dev}) => {
|
||||
|
||||
Reference in New Issue
Block a user