From 6068e0af945767dfe12cacd780cc83b6a73ebb1c Mon Sep 17 00:00:00 2001 From: aube-dev Date: Mon, 16 Sep 2024 19:44:21 +0900 Subject: [PATCH] feat: add regex to check `API_URL` --- server/constants/env.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/constants/env.ts b/server/constants/env.ts index 6449f18..63ff568 100644 --- a/server/constants/env.ts +++ b/server/constants/env.ts @@ -1,10 +1,14 @@ import { z } from 'zod'; export const clientEnvSchema = z.object({ - API_URL: z.string(), + API_URL: z.string().regex(/^(.*[^/])$/g, { + message: 'API 주소는 슬래시(/)로 끝나지 않아야 합니다.', + }), }); export const serverEnvSchema = z.object({ AUTH_COOKIE_SESSION_SECRET: z.string(), - API_URL: z.string(), + API_URL: z.string().regex(/^(.*[^/])$/g, { + message: 'API 주소는 슬래시(/)로 끝나지 않아야 합니다.', + }), });