Nextjs请求代理配置

Nextjs版本:14.0.3

修改next.config.js文件

/** @type {import('next').NextConfig} /
const nextConfig = {
/
* @description 开发模式下请求代理设置 /
async rewrites() {
return {
fallback: [
{
source: '/api/:path
',
destination: 'https://loaclhost:8060/:path*',
},
]
}
},
}

module.exports = nextConfig

posted @ 2024-01-23 16:21  开水泡可乐  阅读(1014)  评论(0)    收藏  举报