mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-21 12:53:56 +01:00
api strings
This commit is contained in:
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);
|
||||
}
|
||||
Reference in new issue
Block a user