feat. 환경 세팅

This commit is contained in:
김채린
2025-09-09 03:34:09 +00:00
parent 52b2b6719b
commit 9581e5d356
119 changed files with 13160 additions and 86 deletions

View File

@@ -0,0 +1,16 @@
import { getHeader, getRequestHost, defineEventHandler } from "h3";
export default defineEventHandler((event) => {
const host =
(getHeader(event, "host") || getRequestHost(event)).toString() || "";
const baseDomain = process.env.BASE_DOMAIN || ".onstove.com";
const isGameAliasExtractable = host.includes(baseDomain);
if (isGameAliasExtractable) {
const gameAlias = host.split(".")[0];
if (gameAlias && gameAlias !== "www") {
event.context.gameAlias = gameAlias;
}
}
});