Skip to content

Commit 70e5bd4

Browse files
committed
chore: revert with fetch again
1 parent 1872162 commit 70e5bd4

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

apps/insights/src/config/server.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Disable the following rule because this file is the intended place to declare
22
// and load all env variables.
3-
/* eslint-disable n/no-process-env, @typescript-eslint/no-non-null-assertion, turbo/no-undeclared-env-vars */
3+
/* eslint-disable n/no-process-env */
44

55
import { Redis } from 'ioredis';
66
import "server-only";
@@ -63,10 +63,7 @@ export const ENABLE_ACCESSIBILITY_REPORTING =
6363
let redisClient: Redis | undefined;
6464

6565
export function getRedis(): Redis {
66-
const url = process.env.REDIS_URL;
67-
if (!url) {
68-
throw new Error('REDIS_URL must be set');
69-
}
66+
const url = demand("REDIS_URL");
7067
if(redisClient) {
7168
return redisClient;
7269
}
@@ -76,13 +73,14 @@ export function getRedis(): Redis {
7673

7774
export const PUBLIC_URL = (() => {
7875
if (IS_PRODUCTION_SERVER) {
79-
80-
return `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL!}`;
76+
const productionUrl = demand("VERCEL_PROJECT_PRODUCTION_URL");
77+
return `https://${productionUrl}`;
8178
} else if (IS_PREVIEW_SERVER) {
82-
return `https://${process.env.VERCEL_URL!}`;
79+
const previewUrl = demand("VERCEL_URL");
80+
return `https://${previewUrl}`;
8381
} else {
8482
return `http://localhost:3003`;
8583
}
8684
})();
8785

88-
export const VERCEL_AUTOMATION_BYPASS_SECRET = process.env.VERCEL_AUTOMATION_BYPASS_SECRET!;
86+
export const VERCEL_AUTOMATION_BYPASS_SECRET = demand("VERCEL_AUTOMATION_BYPASS_SECRET");

apps/insights/turbo.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"DISABLE_ACCESSIBILITY_REPORTING",
1717
"NEXT_PUBLIC_PYTHNET_RPC",
1818
"NEXT_PUBLIC_PYTHTEST_CONFORMANCE_RPC",
19-
"REDIS_URL"
19+
"REDIS_URL",
20+
"VERCEL_PROJECT_PRODUCTION_URL"
2021
]
2122
},
2223
"fix:lint": {

0 commit comments

Comments
 (0)