From eb360cb113e8e2dc66d11c94ea7f57421a086328 Mon Sep 17 00:00:00 2001 From: fadhlaouir Date: Fri, 15 Mar 2024 11:35:59 +0100 Subject: [PATCH] fix: Delete firebase from the project --- .gitignore | 3 ++- app.js | 8 +------- src/utils/helpers.js | 26 -------------------------- 3 files changed, 3 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index 4c2366a..22cdd50 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /node_modules npm-debug.log +package-lock.json .DS_Store /uploads -/.env \ No newline at end of file +/.env diff --git a/app.js b/app.js index 261a12f..ebf8b93 100644 --- a/app.js +++ b/app.js @@ -10,9 +10,6 @@ const bodyParser = require('body-parser'); var cors = require('cors'); const path = require('path'); const mongoose = require('mongoose'); -// Firebase -require('firebase/auth'); -require('firebase/firestore'); // Swagger const swaggerUi = require('swagger-ui-express'); @@ -25,14 +22,11 @@ dotenv.config(); const app = express(); // DATABASE CONNECTION +mongoose.set('strictQuery', false); mongoose.connect( process.env.NODE_ENV === 'production' ? process.env.PROD_DATABASE : process.env.DEV_DATABASE, - { - useNewUrlParser: true, - useUnifiedTopology: true, - }, (err) => { if (err) { console.log(err); diff --git a/src/utils/helpers.js b/src/utils/helpers.js index 657e5e6..9104d2e 100644 --- a/src/utils/helpers.js +++ b/src/utils/helpers.js @@ -3,7 +3,6 @@ /* -------------------------------------------------------------------------- */ // Dependencies const _ = require('lodash'); -var admin = require('firebase-admin'); /* -------------------------------------------------------------------------- */ /* HELPERS */ @@ -40,33 +39,8 @@ function getfilteredObjectOfObject(object, lang) { return output[0]; } -/** - * Fire base admin configuration to send notification for mobile users - */ -const serviceAccount = { - type: process.env.FIREBASE_TYPE, - project_id: process.env.PROJECT_ID, - private_key_id: process.env.PRIVATE_KEY_ID, - private_key: process.env.PRIVATE_KEY, - client_email: process.env.CLIENT_EMAIL, - client_id: process.env.CLIENT_ID, - auth_uri: process.env.AUTH_URI, - token_uri: process.env.TOKEN_URI, - auth_provider_x509_cert_url: process.env.AUTH_PROVIDER, - client_x509_cert_url: process.env.CLIENT_CERT_URL, -}; - -/** - * Initialize firebase app - */ -const firebaseAdmin = admin.initializeApp({ - credential: admin.credential.cert(serviceAccount), -}); - // export module module.exports = { getfilteredArrayOfObject, getfilteredObjectOfObject, - serviceAccount, - firebaseAdmin, };