mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
fix: code split correctly
This commit is contained in:
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' } },
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user