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

Fix env detection #292

Merged
merged 2 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# For emoji board
DATABASE_URL='mysql://...'
# For emoji board and blog post views
REDIS_REST_API_TOKEN="...="
REDIS_REST_API_URL="..."
VERCEL_ENV="development"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ yarn-error.log*
.vercel

# contentlayer
.contentlayer
.contentlayer
2 changes: 1 addition & 1 deletion src/lib/database/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function getEmojiKey(emojiName: EmojiName) {
}

function getEnvStorageKey(key: string) {
const env = process.env.NODE_ENV;
const env = process.env.VERCEL_ENV;
const envPrefix = env === 'production' ? 'production' : 'staging';

return `${envPrefix}:${key}`;
Expand Down
Loading