我使用的依赖项要求我在本地主机上具有 HTTPS。我在 nuxt.config.js 中使用了以下代码来完成此任务:
server: {
https: {
key: fs.readFileSync(path.resolve(__dirname, 'localhost-key.pem')),
cert: fs.readFileSync(path.resolve(__dirname, 'localhost.pem'))
}
},
这些是我用 mkcert 自己创建的密钥。但是,我将在实时页面上使用实际的证书。有没有办法将 nuxt.config.js 中的服务器块限制为仅开发模式?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号