feat/op:uploads path use rewrite

This commit is contained in:
riverLethe committed 2025-10-20 14:57:33 +08:00
1 parent 3321efc3d4
commit 434518b2b3
1 file changed
+14 -12
+14 -12
View File
@@ -19,18 +19,20 @@ const nextConfig = {
async redirects() {
return [];
},
// async rewrites() {
// return [
// {
// source: "/api/:path*",
// destination: `${process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001"}/api/:path*`,
// },
// {
// source: "/uploads/:path*",
// destination: `${process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001"}/uploads/:path*`,
// },
// ];
// },
async rewrites() {
return [
// {
// source: "/api/:path*",
// destination: `${process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001"}/api/:path*`,
// },
{
source: "/uploads/:path*",
destination: `${
process.env.NEXT_PUBLIC_API_URL || "http://127.0.0.1:8001"
}/uploads/:path*`,
},
];
},
// Headers for better performance
async headers() {