mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-14 03:39:16 +00:00
Update BASE_PATH handling in next.config and fix fetch URLs to ensure correct path structure in API routes
This commit is contained in:
parent
306fd8e26c
commit
562ba92ee9
@ -15,11 +15,11 @@ const nextConfig = {
|
||||
},
|
||||
|
||||
env: {
|
||||
BASE_PATH: "/ProxmoxVE",
|
||||
BASE_PATH: "ProxmoxVE",
|
||||
},
|
||||
|
||||
output: "export",
|
||||
basePath: "/ProxmoxVE",
|
||||
basePath: `/${process.env.BASE_PATH}`,
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
@ -6,7 +6,7 @@ export const dynamic = "force-static";
|
||||
|
||||
const fetchCategories = async (): Promise<Category[]> => {
|
||||
const response = await fetch(
|
||||
`https://raw.githubusercontent.com/community-scripts${basePath}/refs/heads/main/json/metadata.json`,
|
||||
`https://raw.githubusercontent.com/community-scripts/${basePath}/refs/heads/main/json/metadata.json`,
|
||||
);
|
||||
const data = await response.json();
|
||||
return data.categories;
|
||||
@ -14,7 +14,7 @@ const fetchCategories = async (): Promise<Category[]> => {
|
||||
|
||||
const fetchScripts = async (): Promise<Script[]> => {
|
||||
const response = await fetch(
|
||||
`https://api.github.com/repos/community-scripts${basePath}/contents/json`,
|
||||
`https://api.github.com/repos/community-scripts/${basePath}/contents/json`,
|
||||
);
|
||||
const files: { download_url: string }[] = await response.json();
|
||||
const scripts = await Promise.all(
|
||||
|
Loading…
Reference in New Issue
Block a user