From 29e0ef8c580018743621a59a6e7a6785a601118c Mon Sep 17 00:00:00 2001 From: sscoderati <69716992+sscoderati@users.noreply.github.com> Date: Thu, 29 Feb 2024 12:24:53 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Feat(#47):=20=EB=A9=94=EC=9D=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=82=AC=EC=9D=B4=ED=8A=B8?= =?UTF-8?q?=EB=A7=B5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/sitemap.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/app/sitemap.ts diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts new file mode 100644 index 00000000..8396151b --- /dev/null +++ b/src/app/sitemap.ts @@ -0,0 +1,19 @@ +import type { MetadataRoute } from "next"; +import { axiosInstance } from "@/services"; + +type Steady = { + id: number; + createdAt: Date; +}; + +export default async function sitemap(): Promise { + const response = await axiosInstance.get( + `/api/v1/steadies/search?page=0&like=false&status=RECRUITING`, + ); + return response.data.content.map((steady: Steady) => ({ + url: `/steadies/${steady.id}`, + changefreq: "daily", + priority: 0.9, + lastModified: new Date(steady.createdAt).toISOString(), + })); +}