Fix serversideprops using localhost instead of domain.

This commit is contained in:
mbaharip
2023-04-28 00:53:52 +07:00
parent df1173632e
commit cda596d312
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -148,7 +148,9 @@ export default function File({ passwordParent, fileName }: Props) {
export async function getServerSideProps(context: GetServerSidePropsContext) {
const { id } = context.query;
const data = await axios.get(`http://localhost:5000/api/files/${id}`);
const data = await axios.get(
`${process.env.NEXT_PUBLIC_DOMAIN}/api/files/${id}`,
);
context.res.setHeader(
"Cache-Control",
+3 -1
View File
@@ -234,7 +234,9 @@ export default function Folder({ passwordParent, folderName }: Props) {
export async function getServerSideProps(context: GetServerSidePropsContext) {
const { id } = context.query;
const data = await axios.get(`http://localhost:5000/api/files/${id}`);
const data = await axios.get(
`${process.env.NEXT_PUBLIC_DOMAIN}/api/files/${id}`,
);
context.res.setHeader(
"Cache-Control",