fixed bug globalServerProps

This commit is contained in:
AmirHossein Mahmoodi
2023-12-20 13:28:35 +03:30
parent 532d5d417d
commit 1a6612a25f

View File

@@ -1,10 +1,13 @@
import {parse} from "next-useragent";
import process from "next/dist/build/webpack/loaders/resolve-url-loader/lib/postcss";
export const globalServerProps = async ({req, locale}) => {
const {isBot} = parse(req.headers["user-agent"]);
const responseConfig = await fetch(process.env.NEXT_PUBLIC_CONFIG_APP_URL);
return {
config: (await import(`&/config.json`)).default,
config: await responseConfig.json(),
messages: (await import(`&/locales/${locale}/app.json`)).default,
isBot,
locale,