mirror of
https://github.com/Nezumi-2711/next-gdrive-index.git
synced 2026-09-23 04:10:03 +00:00
Fix serversideprops using localhost instead of domain.
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user