forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsitemap.ts
More file actions
23 lines (19 loc) · 698 Bytes
/
Copy pathsitemap.ts
File metadata and controls
23 lines (19 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { MetadataRoute } from 'next';
import envConfig from './src/constants/envConfig';
import getPublicMemoriesPrerender from './src/actions/memories/get-public-memories-prerender';
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
if (envConfig.IS_DEVELOPMENT) return [];
const urls = [{ path: 'memories', priority: 0.7 }];
const memories = await getPublicMemoriesPrerender(20000);
const memoriesUrls = memories.map((memory) => ({
path: 'memories/' + memory.id,
priority: 0.9,
}));
urls.push(...memoriesUrls);
return urls.map((item) => {
return {
url: `${envConfig.API_URL}/${item.path}`,
priority: item.priority,
};
});
}