本文介绍了如何更改 node.js 中 process.env.PORT 的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我想更改 process.env.PORT 的值,我该怎么做?

I'd like to change the value of process.env.PORT, how can I do this?

我正在运行 Ubuntu 12.04.

I'm running Ubuntu 12.04.

推荐答案

只需运行一次(在 unix shell 提示符下):

For just one run (from the unix shell prompt):

$ PORT=1234 node app.js

更永久:

$ export PORT=1234
$ node app.js

Windows 中:p>

In Windows:

set PORT=1234

在 Windows PowerShell:

In Windows PowerShell:

$env:PORT = 1234

这篇关于如何更改 node.js 中 process.env.PORT 的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 16:50