From c802c68158044ebb99cef08014c714906a1741e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Chyeonggkim=E2=80=9D?=
<“hyeonggkim@smilegate.com”>
Date: Fri, 27 Mar 2026 17:59:14 +0900
Subject: [PATCH 1/4] =?UTF-8?q?refactor:=20=EB=A1=9C=EA=B9=85=20=EC=A0=95?=
=?UTF-8?q?=EB=B3=B4=20=EA=B0=9C=EC=84=A0-=EB=8F=84=EB=A9=94=EC=9D=B8=20?=
=?UTF-8?q?=EC=B6=94=EA=B0=80,=20robots.txt=20=EC=82=AC=EC=9D=B4=ED=8A=B8?=
=?UTF-8?q?=EB=A7=B5=20=EA=B2=BD=EB=A1=9C=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.cursorrules | 8 ++++++++
layers/server/plugins/nitroPlugin.ts | 11 ++++++-----
layers/server/routes/robots.txt.ts | 29 ++++++++++++++--------------
3 files changed, 28 insertions(+), 20 deletions(-)
create mode 100644 .cursorrules
diff --git a/.cursorrules b/.cursorrules
new file mode 100644
index 0000000..24af5b2
--- /dev/null
+++ b/.cursorrules
@@ -0,0 +1,8 @@
+# 커밋 메시지 (Generate Commit Message 포함)
+
+커밋 메시지는 **반드시 한글**로 작성한다.
+
+- 형식: `feat: 내용`, `refactor: 내용`, `test: 내용` 등
+- 내용은 한글로, 제목 한 줄, 변경 의도가 드러나게 간결하게
+
+예: `feat: 회원 가입 폼 유효성 검사 추가`, `refactor: 결제 모듈 상태 관리 로직 분리`
diff --git a/layers/server/plugins/nitroPlugin.ts b/layers/server/plugins/nitroPlugin.ts
index e5919c6..0303285 100644
--- a/layers/server/plugins/nitroPlugin.ts
+++ b/layers/server/plugins/nitroPlugin.ts
@@ -19,7 +19,7 @@ export default defineNitroPlugin(nitroApp => {
// 헬스체크 경로 체크 함수 추가
const isHealthCheck = (path: string): boolean => {
- return path === '/health'
+ return path === '/health' || path === '/api/healthz'
}
nitroApp.hooks.hook('request', event => {
@@ -33,22 +33,23 @@ export default defineNitroPlugin(nitroApp => {
const method = event.method || ''
const headers = JSON.stringify(event.node.req.headers, null, 2)
const requestId = generateRequestId()
+ const domain = event.node.req.headers.host || 'unknown'
- if (process.env.NODE_ENV !== 'development') {
+ // if (process.env.NODE_ENV !== 'development') {
console.log(
- `Request Info {"requestId":"${requestId}", "type":"request","method":"${method}","url":"${event.path}","userIp":"${getIpAddress(event)}","userAgent":"${userAgent}", "headers" : "${headers}" }`
+ `Request Info {"requestId":"${requestId}", "type":"request","method":"${method}","domain":"${domain}","url":"${event.path}","userIp":"${getIpAddress(event)}","userAgent":"${userAgent}", "headers" : "${headers}" }`
)
// 요청 완료 후 응답 상태 코드 로깅
event.node.res.on('finish', () => {
console.log(
- `Response Info {"requestId":"${requestId}","type":"response","method":"${method}","url":"${event.path}","statusCode":${event.node.res.statusCode},"responseTime":"${Date.now() - startTime}ms","userIp":"${getIpAddress(event)}","userAgent":"${userAgent}","statusMessage":"${event.node.res.statusMessage}","responseHeader": ${JSON.stringify(event.node.res.getHeaders(), null, 2)}}`
+ `Response Info {"requestId":"${requestId}","type":"response","method":"${method}","domain":"${domain}","url":"${event.path}","statusCode":${event.node.res.statusCode},"responseTime":"${Date.now() - startTime}ms","userIp":"${getIpAddress(event)}","userAgent":"${userAgent}","statusMessage":"${event.node.res.statusMessage}","responseHeader": ${JSON.stringify(event.node.res.getHeaders(), null, 2)}}`
)
console.log(
'==========================================================================================================================================================================================================================================================='
)
})
- }
+ // }
})
nitroApp.hooks.hook('error', error => {
diff --git a/layers/server/routes/robots.txt.ts b/layers/server/routes/robots.txt.ts
index ffb5192..7eb49b0 100644
--- a/layers/server/routes/robots.txt.ts
+++ b/layers/server/routes/robots.txt.ts
@@ -11,32 +11,31 @@ type RobotsConfig = {
export default defineEventHandler(async event => {
const host =
(getHeader(event, 'host') || getRequestHost(event)).toString() || ''
- const baseDomain = process.env.BASE_DOMAIN || '.onstove.com'
+ const baseDomain = process.env.BASE_DOMAIN
const isGameAliasExtractable = host.includes(baseDomain)
let gameAlias = ''
if (isGameAliasExtractable) {
- gameAlias = host.split('.')[0]
+ gameAlias = host.split('.')[0].replace(/-dev$/, '')
}
- // if (gameAlias && gameAlias !== "www") {
- // event.context.gameAlias = gameAlias;
- // }
- // }
- // robots 설정을 직접 가져오기 (미들웨어 context 사용)
-
let config: RobotsConfig
try {
- // robots 설정 추출
+ const staticUrl = process.env.STATIC_URL
+ const runType = process.env.RUN_TYPE
+
+ // gameAlias가 있을 때만 sitemap 포함
+ const sitemapUrl = gameAlias
+ ? [`${staticUrl}/${runType}/template/${gameAlias}/sitemap.xml`]
+ : undefined
+
config = {
userAgent: '*',
allow: ['/'],
- disallow: ['/error', '/inspection/', '/inspection/*', '/html/*'],
- sitemap: [
- `https://static-pubcomm.gate8.com/local/template/${gameAlias}/sitemap.xml`,
- ],
- host: `${gameAlias}.onstove.com`,
+ disallow: ['/error', '/inspection/*', '/html/*'],
+ sitemap: sitemapUrl,
+ host: gameAlias ? `${gameAlias}.onstove.com` : undefined,
cache: { sMaxAge: 300, staleWhileRevalidate: 600 },
}
} catch (error) {
@@ -46,7 +45,7 @@ export default defineEventHandler(async event => {
config = {
userAgent: '*',
allow: ['/'],
- disallow: ['/error', '/inspection/', '/inspection/*', '/html/*'],
+ disallow: ['/error', '/inspection/*', '/html/*'],
cache: { sMaxAge: 300, staleWhileRevalidate: 600 },
}
}
From 413567750c29c5b027c18ea8c2d2a3560efbdb0a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Chyeonggkim=E2=80=9D?=
<“hyeonggkim@smilegate.com”>
Date: Mon, 30 Mar 2026 14:45:54 +0900
Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=EC=97=90=EB=9F=AC=ED=8E=98?=
=?UTF-8?q?=EC=9D=B4=EC=A7=80,=20=EC=A0=90=EA=B2=80=20=ED=8E=98=EC=9D=B4?=
=?UTF-8?q?=EC=A7=80=20=EB=A1=9C=EB=B4=87=20=EA=B2=80=EC=83=89=20=EC=95=88?=
=?UTF-8?q?=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=B6=94=EA=B0=80=20=20'noindex,?=
=?UTF-8?q?=20nofollow'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/error.vue | 5 +++++
app/pages/inspection/index.vue | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/app/error.vue b/app/error.vue
index 4f9ee5c..4ec56ae 100644
--- a/app/error.vue
+++ b/app/error.vue
@@ -61,6 +61,11 @@
+
diff --git a/layers/layouts/promotion.vue b/layers/layouts/promotion.vue
index 3b1480c..7b85736 100644
--- a/layers/layouts/promotion.vue
+++ b/layers/layouts/promotion.vue
@@ -1,4 +1,68 @@
-
+
From afdaed8890f18b96a653bc02e81c80d432a4ab4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Chyeonggkim=E2=80=9D?=
<“hyeonggkim@smilegate.com”>
Date: Tue, 31 Mar 2026 14:17:08 +0900
Subject: [PATCH 4/4] =?UTF-8?q?refactor:=20Nuxt=20runtimeConfig=20?=
=?UTF-8?q?=EC=82=AC=EC=9A=A9=ED=95=98=EC=97=AC=20robots.txt=20=EC=84=A4?=
=?UTF-8?q?=EC=A0=95=20=EA=B0=9C=EC=84=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
layers/server/routes/robots.txt.ts | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/layers/server/routes/robots.txt.ts b/layers/server/routes/robots.txt.ts
index 7eb49b0..67104c5 100644
--- a/layers/server/routes/robots.txt.ts
+++ b/layers/server/routes/robots.txt.ts
@@ -9,9 +9,19 @@ type RobotsConfig = {
}
export default defineEventHandler(async event => {
- const host =
- (getHeader(event, 'host') || getRequestHost(event)).toString() || ''
- const baseDomain = process.env.BASE_DOMAIN
+ // Nuxt runtimeConfig 사용
+ const runtimeConfig = useRuntimeConfig()
+ const baseDomain = runtimeConfig.public.baseDomain
+ const staticUrl = runtimeConfig.public.staticUrl
+ const runType = runtimeConfig.public.runType
+
+ // 프록시 뒤에 있는 경우 X-Forwarded-Host 우선 사용
+ const forwardedHost = getHeader(event, 'x-forwarded-host')
+ const host = (
+ forwardedHost ||
+ getHeader(event, 'host') ||
+ getRequestHost(event)
+ ).toString() || ''
const isGameAliasExtractable = host.includes(baseDomain)
let gameAlias = ''
@@ -22,9 +32,6 @@ export default defineEventHandler(async event => {
let config: RobotsConfig
try {
- const staticUrl = process.env.STATIC_URL
- const runType = process.env.RUN_TYPE
-
// gameAlias가 있을 때만 sitemap 포함
const sitemapUrl = gameAlias
? [`${staticUrl}/${runType}/template/${gameAlias}/sitemap.xml`]
@@ -79,8 +86,14 @@ export default defineEventHandler(async event => {
: config.sitemap
? [config.sitemap]
: []
- for (const sm of sitemaps) lines.push(`Sitemap: ${sm}`)
- if (config.host) lines.push(`Host: ${config.host}`)
+
+ for (const sm of sitemaps) {
+ lines.push(`Sitemap: ${sm}`)
+ }
+
+ if (config.host) {
+ lines.push(`Host: ${config.host}`)
+ }
// 마지막 개행
return lines.join('\n').trim() + '\n'