From f653b8db934be73fdb8aa0d2e61a42ab46bb46c3 Mon Sep 17 00:00:00 2001 From: manNomi Date: Mon, 3 Aug 2026 23:44:02 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=EC=A4=91=EC=95=99=EB=8C=80=20?= =?UTF-8?q?=EC=8A=AC=EB=9F=AC=EA=B7=B8=EA=B0=80=20university-web=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20rewrite=EB=90=98=EC=A7=80=20=EC=95=8A=EB=8D=98=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/next.config.mjs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 16014cec..7a9a9958 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -21,7 +21,20 @@ const imageRemotePatterns = [ const universityWebDomain = process.env.UNIVERSITY_WEB_DOMAIN?.replace(/\/$/, ""); const isProductionRuntime = process.env.NODE_ENV === "production"; -const universitySlugPattern = "(inha|kyunghee)"; + +/** + * `/university/:homeUniversity` 를 university-web 으로 넘길 홈 대학 슬러그 목록. + * + * 여기에 없는 슬러그는 rewrite 되지 않고 apps/web 으로 떨어져 404 가 된다. + * `/university/score/*`, `/university/application/*` 는 apps/web 소유이므로 + * 와일드카드 대신 allowlist 를 유지한다. + * + * 홈 대학을 추가할 때는 `apps/university-web/src/constants/university.ts` 의 + * `HOME_UNIVERSITY_SLUGS` 와 **이 목록을 함께** 갱신해야 한다. + * (next.config 는 .mjs 라 TS 상수를 직접 import 할 수 없어 수동 동기화가 필요하다.) + */ +const UNIVERSITY_SLUGS = ["inha", "kyunghee", "chungang"]; +const universitySlugPattern = `(${UNIVERSITY_SLUGS.join("|")})`; if (isProductionRuntime && !universityWebDomain) { throw new Error("UNIVERSITY_WEB_DOMAIN is required because /university catalog routes are served by university-web.");