|
1 | 1 | import { createApp } from 'vue' |
2 | 2 | import App from './App.vue' |
3 | 3 | import router from './router' |
4 | | -import firebase from 'firebase' |
| 4 | +import { initializeApp } from 'firebase/app' |
| 5 | +import { getAuth,connectAuthEmulator } from 'firebase/auth'; |
5 | 6 |
|
6 | 7 | /* code from our Firebase console */ |
7 | | -var firebaseConfig = { |
8 | | - apiKey: "YOUR_API_KEY", |
9 | | - authDomain: "YOUR_AUTH_DOMAIN", |
10 | | - projectId: "YOUR_PROJECT_ID", |
11 | | - storageBucket: "YOUR_STORAGE_BUCKET", |
12 | | - messagingSenderId: "YOUR_MESSAGING_SENDER_ID", |
13 | | - appId: "YOUR_APP_ID" |
14 | | - } |
| 8 | +const firebaseConfig = { |
| 9 | + apiKey: "YOUR_API_KEY", |
| 10 | + authDomain: "YOUR_AUTH_DOMAIN", |
| 11 | + projectId: "YOUR_PROJECT_ID", |
| 12 | + storageBucket: "YOUR_STORAGE_BUCKET", |
| 13 | + messagingSenderId: "YOUR_MESSAGING_SENDER_ID", |
| 14 | + appId: "YOUR_APP_ID" |
| 15 | +}; |
15 | 16 |
|
16 | 17 | // Initialize Firebase |
17 | | -firebase.initializeApp(firebaseConfig) |
| 18 | +initializeApp(firebaseConfig) |
| 19 | + |
| 20 | +if (location.hostname === "localhost") { |
| 21 | + connectAuthEmulator(getAuth(), "http://localhost:9099"); |
| 22 | +} |
18 | 23 |
|
19 | 24 | const app = createApp(App) |
20 | 25 |
|
|
0 commit comments