mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This PR fixes two issues with the use of `assetPrefix`: #1: https://github.com/vercel/next.js/issues/64710 `assetPrefix` needs to be handled in `dev`, `deploy`, and `start`. In the current approach, only `dev` and `start` were handled, but a quirk of the implementation caused rewrites for non-asset paths to not be able to be used in `afterFiles` rewrites. #2: When deploying Next.js (such as on Vercel), you need to add your own `beforeFiles` rewrite for `/${assetPrefix}/_next/...` requests or otherwise they would 404. This PR creates an automatically added `rewrite` to `beforeFiles` that handles the case for `dev`, `start`, and `deploy`, removes the existing logic in `filesystem.ts`, and adds more tests to check the behavior.
4 lines
90 B
JavaScript
4 lines
90 B
JavaScript
export default function handler(req, res) {
|
|
res.status(200).json({ message: 'test' })
|
|
}
|