fix: code split correctly

This commit is contained in:
TrèsAbhi committed 2025-05-29 19:28:58 -05:00
1 parent f48c5d246d
commit 9bf1554c30
3 files changed
+10 -11

No files matched your search

@@ -1,18 +1,19 @@
import type { APIRoute, GetStaticPaths, GetStaticPathsItem } from 'astro';
import { catalog } from 'packages/website-ue/src/core/blitz/metadata';
import { socketMetadata } from 'packages/website-ue/src/core/blitz/metadata.socket';
export const getStaticPaths: GetStaticPaths = () => {
const paths: GetStaticPathsItem[] = [];
for (const item in catalog.items) {
for (const item in socketMetadata.items) {
paths.push({ params: { item } });
}
return paths;
};
export const GET: APIRoute<{}, { item: string }> = ({ params }) => {
return new Response(catalog.get(params.item).encode(), {
headers: { 'Content-Type': 'application/octet-stream' },
});
export const GET: APIRoute<{}, { item: string }> = async ({ params }) => {
return new Response(
await socketMetadata.get(params.item).then((item) => item.encode()),
{ headers: { 'Content-Type': 'application/octet-stream' } },
);
};