I have firebase service account in my .env file . The main problem is I am unable to access those in index.js file. I have already tried similar questions in stackoverflow . But those were not helpful to me.
Here is my index.js:
const express = require("express");
const app = express();
const cors = require("cors");
const { MongoClient } = require("mongodb");
const { ObjectId } = require("mongodb");
const admin = require("firebase-admin");
require("dotenv").config();
const port = process.env.PORT || 5000;
//firebase admin initialization
const serviceAccount = JSON.parse(process.env.FIREBASE_SERVICE_ACCOUNT);
admin.initializeApp({
credential : admin.credential.cert(serviceAccount),
}),
});
//middleware
app.use(cors());
app.use(express.json({ limit: "50mb" }));
The occurred error :
.env file: