Skip to content

Commit

Permalink
Fix: eventConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
thxx132 committed Feb 11, 2025
1 parent b7d9389 commit f92adfe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ app.use("/docs", docsRouter);

// [Router] 이벤트 전용 라우터입니다.
if (eventConfig) {
app.use("/events", lotteryRouter);
app.use(`/events/${eventConfig.mode}`, lotteryRouter);
}

// [Middleware] 모든 API 요청에 대하여 origin 검증
Expand Down
11 changes: 9 additions & 2 deletions src/loadenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,15 @@ export const testAccounts =
export const slackWebhookUrl = {
report: process.env.SLACK_REPORT_WEBHOOK_URL || "", // optional
};
export const eventConfig =
process.env.EVENT_CONFIG && JSON.parse(process.env.EVENT_CONFIG); // optional
export const eventConfig = (process.env.EVENT_CONFIG &&
JSON.parse(process.env.EVENT_CONFIG)) || {
mode: "2025spring",
credit: { name: "넙죽코인", initialAmount: 0 },
period: {
startAt: "2024-09-03T00:00:00+09:00",
endAt: "2024-09-24T00:00:00+09:00",
},
};
export const naverMap = {
apiId: process.env.NAVER_MAP_API_ID || "", // optional
apiKey: process.env.NAVER_MAP_API_KEY || "", // optional
Expand Down

0 comments on commit f92adfe

Please sign in to comment.