Skip to content

Commit

Permalink
✨ Feat(#47): 메인 페이지 사이트맵 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
sscoderati committed Feb 29, 2024
1 parent 73c808b commit 29e0ef8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -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<MetadataRoute.Sitemap> {
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(),
}));
}

0 comments on commit 29e0ef8

Please sign in to comment.