簡體   English   中英

如何更改 Remix.run 的本地開發服務器使用的端口?

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

默認情況下,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

你如何改變它運行的端口?

從 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM