mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-25 03:29:51 +01:00
feat: docs
This commit is contained in:
1 parent
7e11c1e5ce
commit
6a21c9aaac
8 files changed
+76
-7
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { StuffUIComponent } from '@protos/blitz_static_stuff_ui_component';
|
||||
import type { APIRoute, GetStaticPaths } from 'astro';
|
||||
import { api } from 'packages/website-ue/src/core/blitzkit/api';
|
||||
|
||||
export const getStaticPaths: GetStaticPaths = () => {
|
||||
return api.metadata
|
||||
.filter((item) => item.startsWith('CurrencyEntity.'))
|
||||
.map((item) => ({
|
||||
params: { currency: item.undiscriminatedId() },
|
||||
props: { ui: item.get(StuffUIComponent, 'UIComponent') },
|
||||
}));
|
||||
};
|
||||
|
||||
export const GET: APIRoute<{ ui: StuffUIComponent }> = async ({ props }) => {
|
||||
console.log(props.ui.icon);
|
||||
|
||||
const response = await fetch(props.ui.icon);
|
||||
const buffer = await response.arrayBuffer();
|
||||
|
||||
return new Response(buffer, { headers: response.headers });
|
||||
};
|
||||
Reference in new issue
Block a user