-1

默认情况下,Remix.run 在运行时似乎使用 3000 端口进行本地开发:

❯ npm run dev

> dev
> concurrently "npm run dev:css" "remix dev"

[0]
[0] > dev:css
[0] > tailwindcss -o ./app/styles/tailwind.css --watch
[0]
[1] Watching Remix app in development mode...
[1]  Built in 161ms
[1] Remix App Server started at http://localhost:3000

你如何改变它运行的端口?

4

1 回答 1

1

从 v1.1.3(~2022 年 1 月)开始,本地开发端口配置PORT环境变量。

例子:

PORT=10000 npm run dev

> dev
> concurrently "npm run dev:css" "remix dev"

[0]
[0] > dev:css
[0] > tailwindcss -o ./app/styles/tailwind.css --watch
[0]
[1] Watching Remix app in development mode...
[1]  Built in 162ms
[1] Remix App Server started at http://localhost:10000
于 2022-01-29T16:37:18.530 回答