Skip to content

Commit b687065

Browse files
committed
(demo) use .env firebase config
1 parent c53cbbd commit b687065

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

demo/src/firestore/index.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@ import * as app from 'firebase/app'
22
import 'firebase/firestore'
33
import 'firebase/storage'
44

5-
const config = JSON.parse(process.env.VUE_APP_FIREBASE_CONFIG) || {
6-
apiKey: 'AIzaSyCVy3Oc1jgvacBZe5hKBA8mV9EOqmqUG0U',
7-
authDomain: 'sandbox-public.firebaseapp.com',
8-
databaseURL: 'https://sandbox-public.firebaseio.com',
9-
projectId: 'sandbox-public',
10-
storageBucket: 'sandbox-public.appspot.com',
11-
messagingSenderId: '694742394920',
12-
appId: '1:694742394920:web:af0d589c7618f85ccc2d1d'
13-
}
5+
const config =
6+
process.env.NODE_ENV === 'development'
7+
? JSON.parse(process.env.VUE_APP_FIREBASE_CONFIG)
8+
: JSON.parse(process.env.VUE_APP_FIREBASE_CONFIG_PUBLIC)
149

1510
app.initializeApp(config)
1611

0 commit comments

Comments
 (0)