Skip to content

笔记

Main Features

  • 文件路由
  • 静态和动态渲染
  • Styling
  • 图像、字体、脚本优化
  • API

API

middleware.ts

next.config.js

接口转发

javascript
/** @type {import('next').NextConfig} */
const nextConfig = {
  async rewrites() {
    return [
      {
        source: '/api/:path*',
        // http://staking-event.dipbit.xyz/v1/prize/result
        destination: 'http://staking-event.dipbit.xyz/v1/:path*',
      },
    ]
  },  
}

module.exports = nextConfig

更新: 2023-08-04 10:35:30
原文: https://www.yuque.com/u3641/dxlfpu/lisob5hlm9uk0p53