Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefix CLOUDINARY ENVs, move to top-level config #16

Open
coolaj86 opened this issue Sep 8, 2021 · 1 comment
Open

Prefix CLOUDINARY ENVs, move to top-level config #16

coolaj86 opened this issue Sep 8, 2021 · 1 comment

Comments

@coolaj86
Copy link

coolaj86 commented Sep 8, 2021

Re:

cloudinary.config({

API_KEY is rather generic. I'd recommend CLOUDINARY_API_KEY. Also, I'd recommend using global config up to the top level for 2 reasons:

  1. Anything that requires process.env requires more documentation / education if it exists anywhere except the top-level app.js / server.js. Better to consolidate it.
  2. If it's truly a singleton, and you can't configure it, then best to put it at a top-level scope rather than down in routes, unless it's a "mini app" or sub route which might have configuration of its own and act in standalone fashion too

Didn't quite articulate that perfectly, but you get the point I think.

@coolaj86
Copy link
Author

coolaj86 commented Sep 8, 2021

Also, it looks like you're re-initializing the global config many times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant