rjwignar / AIChefBot

Your AI-Powered Recipe Generator
https://ai-chef-bot.vercel.app
3 stars 0 forks source link

environment variables for development environment #164

Open kpunno opened 7 months ago

kpunno commented 7 months ago

We should be able to disable recipe generating during development for concerns of testing (faster recipe generation) and cost.

Option A.

Check if GENERATE_IMAGES=TRUE

If this environment variable is false or not set or doesn't exist, we can do something like

if (process.env.GENERATE_IMAGES == 'TRUE') {
  requestImages();
}
else {
  return;
}

This will protect calling the API and recipes will receive the default image.

Option B.

Alternatively, we can do something like flip it so that when we have the environment variable GENERATE_IMAGES=FALSE, we don't generate images. This will save us on one environment variable both locally and on deployment (where we presumably want images).

if (process.env.GENERATE_IMAGES == 'FALSE') {
   return;
}