Firebase Cloud Functions - FIREBASE_CONFIG environment variable is missing

Viewed 3138

I have initialized a new project of NestJS inside /functions. After I've done that, I installed:

npm install firebase-admin firebase-functions

After that, I had to link the app to cloud functions like so:

const bootstrap = async (expressInstance: Express) => {
  const app = await NestFactory.create(AppModule, expressInstance);
  await app.listen(3000); // Just for easy way to develop
  await app.init();
};

bootstrap(server);

exports.api = functions.https.onRequest(server);

In the app, I had to use firebase-admin to authorize a user. And here's the problem. I assume that running firebase serve --only=function, it will set FIREBASE_CONFIG, while I, running nodemon, won't set FIREBASE_CONFIG.

I was wondering, how can I set this variable, and what it contains, so I could know how to set it properly.

1 Answers
Related