javascript - 如何在 next.js 中设置端口
问题描述
一个应用程序在端口 3000 上运行,我想在默认端口的不同端口上运行另一个应用程序。我如何在 React Next.js 中改变它。我的package.js脚本是
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "next",
"build": "next build",
"start": "next start"
},
并且启动脚本命令是
npm run dev
解决方案
这对我有用
"scripts": {
"dev": "next -p 8080"
},
推荐阅读
- java - Dart 中的类对象列表
- node.js - Gulp 生成的我的 Dist 文件夹是否可能包含在 node_modules 中发现的漏洞?
- google-apps-script - Google Apps 脚本:向电子表格所有者显示警报,但不向编辑者显示
- tableau-api - Tableau:多用户筛选器
- php - 何时为 MYSQL 查询使用锁
- javascript - 将文本添加到具有 ID 的元素的最佳方式?
- apache-spark - 当 Docker 映像使用非 root 用户时,在 Kubernetes 中运行 SparkPi 会引发 AccessDeniedException
- r - 使用具有 100 多个变量的 pivot_wider
- spring-boot - Gradle 将工件发布到 Bitbucket
- git - 我的 Mac 中是否安装了 2 种 git?如果是这样,默认情况下将使用哪一个?