gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 01:25:20 25 4
gpt4 key购买 nike

默认情况下,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 月)起,本地开发端口为 configured使用 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

关于javascript - 如何更改 Remix.run 的本地开发服务器使用的端口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70907527/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com