本页还没有译文
本页 5 段还没译成简体中文,下面显示的是英文原文。allowedDevOrigins
还没翻译译自英文(nextjs.org)本页 5 段都还没译
Next.js blocks cross-origin requests to dev-only assets and endpoints during development by default to prevent unauthorized access.
To configure a Next.js application to allow requests from origins other than the hostname the server was initialized with (localhost by default), use the allowedDevOrigins config option.
allowedDevOrigins lets you set additional origins that can request the dev server in development mode. For example, to use local-origin.dev instead of only localhost, open next.config.js and add the allowedDevOrigins config:
next.config.js
module.exports = {
allowedDevOrigins: ['local-origin.dev', '*.local-origin.dev'],
}AI 翻译查看英文原文