Skip to content

Commit

Permalink
fix: Delete firebase from the project
Browse files Browse the repository at this point in the history
  • Loading branch information
fadhlaouir committed Mar 15, 2024
1 parent b737f27 commit eb360cb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 34 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/node_modules
npm-debug.log
package-lock.json
.DS_Store
/uploads
/.env
/.env
8 changes: 1 addition & 7 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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);
Expand Down
26 changes: 0 additions & 26 deletions src/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/* -------------------------------------------------------------------------- */
// Dependencies
const _ = require('lodash');
var admin = require('firebase-admin');

/* -------------------------------------------------------------------------- */
/* HELPERS */
Expand Down Expand Up @@ -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,
};

0 comments on commit eb360cb

Please sign in to comment.