简体   繁体   English

如何更改 Remix.run 的本地开发服务器使用的端口?

[英]How do I change the port used by Remix.run's local development server?

By default, Remix.run seems to use Port 3000 for local development when running:默认情况下,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

How do you change the port it runs on?你如何改变它运行的端口?

As of v1.1.3 (~Jan 2022), the local development port is configured with the PORT environment variable.从 v1.1.3(~2022 年 1 月)开始,本地开发端口配置PORT环境变量。

Example:例子:

PORT=10000 npm run dev

Gives

> 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM