From 48dac57f8ff56e36da77a28f72c36e63a930a6a7 Mon Sep 17 00:00:00 2001 From: Kyle Killion Date: Sat, 17 Aug 2024 20:49:35 -0700 Subject: [PATCH] Throw an error if the API or APP URIs don't start with http --- packages/api/src/app/constants.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/api/src/app/constants.ts b/packages/api/src/app/constants.ts index c01ea9d..847baa6 100644 --- a/packages/api/src/app/constants.ts +++ b/packages/api/src/app/constants.ts @@ -27,6 +27,14 @@ export const DISABLE_SIGNUPS = validateEnv("DISABLE_SIGNUPS", "false").toLowerCa export const API_URI = validateEnv("API_URI", "http://localhost:4000"); export const APP_URI = validateEnv("APP_URI", "http://localhost:3000"); +if (!API_URI.startsWith("http")) { + throw new Error("API_URI must start with 'http'"); +} + +if (!APP_URI.startsWith("http")) { + throw new Error("APP_URI must start with 'http'"); +} + // AWS export const AWS_REGION = validateEnv("AWS_REGION"); export const AWS_ACCESS_KEY_ID = validateEnv("AWS_ACCESS_KEY_ID");