Skip to content

Commit

Permalink
adjust config based on environment
Browse files Browse the repository at this point in the history
  • Loading branch information
xtatanx committed Jul 18, 2023
1 parent f2959b7 commit d5f187b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions data.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { Firestore } from '@google-cloud/firestore';

const db = new Firestore({
import { isDev } from './utils.js';
const config = {
projectId: process.env.FIRESTORE_PROJECT_ID,
credentials: {
};

if (isDev()) {
config.credentials = {
client_email: process.env.FIRESTORE_CLIENT_EMAIL,
private_key: process.env.FIRESTORE_PRIVATE_KEY,
},
});
};
}

const db = new Firestore(config);

export async function addProcessedAuctions(cars) {
console.log('::: adding processed auctions :::');
Expand Down

0 comments on commit d5f187b

Please sign in to comment.