diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 403e367..3a9e8a6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -48,6 +48,7 @@ jobs: echo "CACHE_MAX=${{ secrets.CACHE_MAX }}" >> .env echo "SLACK_URL=${{ secrets.SLACK_URL }}" >> .env echo "SLACK_MESSAGE_TEMPLETE=${{ secrets.DEV_SLACK_MESSAGE_TEMPLETE }}" >> .env + echo "HOLIDAY_SERVICE_KEY=${{ secrets.HOLIDAY_SERVICE_KEY }}" > .env - name: Install dependencies run: npm install diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index bdeb06d..b33501e 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -48,6 +48,7 @@ jobs: echo "CACHE_MAX=${{ secrets.CACHE_MAX }}" >> .env echo "SLACK_URL=${{ secrets.SLACK_URL }}" >> .env echo "SLACK_MESSAGE_TEMPLETE=${{ secrets.DEV_SLACK_MESSAGE_TEMPLETE }}" >> .env + echo "HOLIDAY_SERVICE_KEY=${{ secrets.HOLIDAY_SERVICE_KEY }}" > .env - name: Install dependencies run: npm install diff --git a/src/main.ts b/src/main.ts index 9bb3862..ad9655c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -14,7 +14,7 @@ export async function bootstrap() { console.log(process.env); const app = await NestFactory.create(AppModule, { cors: true }); app.enableCors({ - origin: true, + origin: ['https://futsal-kumoh.kro.kr', 'http://kumoh-futsal.kro.kr'], exposedHeaders: ['Access_token', 'Refresh_token'], methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS', credentials: true, diff --git a/src/reservation/reservation-slot.builder.ts b/src/reservation/reservation-slot.builder.ts index d8d8dde..d075721 100644 --- a/src/reservation/reservation-slot.builder.ts +++ b/src/reservation/reservation-slot.builder.ts @@ -2,13 +2,15 @@ import axios from 'axios'; import dayjs, { Dayjs } from 'dayjs'; export class ReservationSlotBuilder { + private readonly ServiceKey = + process.env.HOLIDAY_SERVICE_KEY; constructor(private nextMonth: Dayjs, private today: Dayjs) {} async getPublicHolidays(year: number, month: number) { const publicList: string[] = []; try { - const url = `http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService/getHoliDeInfo?ServiceKey=sPWOL4v2MOAE7sUq055%2BwdPT7voiyC2O97JQXNOnraKoP1hYApVuDOdnqZo9Q%2Bvz7olpXweaxcfSUJW1euhSGA%3D%3D&solYear=${year}&solMonth=${ + const url = `http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService/getHoliDeInfo?ServiceKey=${this.ServiceKey}&solYear=${year}&solMonth=${ month + 1 }`; const response = await axios.get(url);