api strings

This commit is contained in:
tresabhi committed 2026-09-22 16:38:30 -05:00
1 parent 99317c2075
commit 5f24887535
23 files changed
+132 -118

No files matched your search

@@ -0,0 +1,14 @@
import locales from "@blitzkit/i18n/locales.json";
import type { APIContext } from "astro";
import { mixStaticPaths } from "../../../astro/mixStaticPaths";
import { api } from "../../../blitzkit/api";
import { getStaticPaths as _getStaticPaths } from "../_index";
export const getStaticPaths = mixStaticPaths(_getStaticPaths, () => {
return locales.supported.map(({ locale }) => ({ params: { locale } }));
});
export async function GET({ params }: APIContext<never, { locale: string }>) {
const strings = await api.strings(params.locale);
return Response.json(strings);
}