mirror of
https://github.com/lobehub/lobehub
synced 2026-04-21 17:47:27 +00:00
* ♻️ refactor: refactor the db code * ✅ test: fix test * ♻️ refactor: refactor the user model
21 lines
510 B
TypeScript
21 lines
510 B
TypeScript
import { DEFAULT_LANG } from '@/const/locale';
|
|
|
|
import { PluginStore } from './Store';
|
|
|
|
export const runtime = 'edge';
|
|
|
|
export const GET = async (req: Request) => {
|
|
const locale = new URL(req.url).searchParams.get('locale');
|
|
|
|
const pluginStore = new PluginStore();
|
|
|
|
let res: Response;
|
|
|
|
res = await fetch(pluginStore.getPluginIndexUrl(locale as any), { next: { revalidate: 3600 } });
|
|
|
|
if (res.status === 404) {
|
|
res = await fetch(pluginStore.getPluginIndexUrl(DEFAULT_LANG));
|
|
}
|
|
|
|
return res;
|
|
};
|