Skip to content

Commit

Permalink
Merge pull request #292 from kirillkurko/fix-env-detection
Browse files Browse the repository at this point in the history
Fix env detection
  • Loading branch information
kirillkurko authored Mar 17, 2024
2 parents 3b6bff0 + 7e3161c commit 4c1071d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
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

0 comments on commit 4c1071d

Please sign in to comment.