怎樣使用nodejs更改項(xiàng)目端口號(hào)
來源:懂視網(wǎng)
責(zé)編:小采
時(shí)間:2020-11-27 19:44:00
怎樣使用nodejs更改項(xiàng)目端口號(hào)
怎樣使用nodejs更改項(xiàng)目端口號(hào):這次給大家?guī)碓鯓邮褂胣odejs更改項(xiàng)目端口號(hào),使用nodejs更改項(xiàng)目端口號(hào)的注意事項(xiàng)有哪些,下面就是實(shí)戰(zhàn)案例,一起來看一下。在項(xiàng)目中加入文件:ServerConfvar ServerConf= { ApiHost: "" //后臺(tái)鏈接api ,ServicePort:30
導(dǎo)讀怎樣使用nodejs更改項(xiàng)目端口號(hào):這次給大家?guī)碓鯓邮褂胣odejs更改項(xiàng)目端口號(hào),使用nodejs更改項(xiàng)目端口號(hào)的注意事項(xiàng)有哪些,下面就是實(shí)戰(zhàn)案例,一起來看一下。在項(xiàng)目中加入文件:ServerConfvar ServerConf= { ApiHost: "" //后臺(tái)鏈接api ,ServicePort:30
這次給大家?guī)碓鯓邮褂胣odejs更改項(xiàng)目端口號(hào),使用nodejs更改項(xiàng)目端口號(hào)的注意事項(xiàng)有哪些,下面就是實(shí)戰(zhàn)案例,一起來看一下。
在項(xiàng)目中加入文件:ServerConf
var ServerConf= {
ApiHost: "" //后臺(tái)鏈接api
,ServicePort:3003
};
module.exports=ServerConf;
app.js
// 設(shè)置端口號(hào)
var ServerConf=require("./ServerConf");

列表內(nèi)容
process.env.PORT=ServerConf.ServicePort;//設(shè)置端口號(hào),不要占用了。
相信看了本文案例你已經(jīng)掌握了方法,更多精彩請(qǐng)關(guān)注Gxl網(wǎng)其它相關(guān)文章!
推薦閱讀:
怎樣使用Nodejs內(nèi)存治理
怎樣修改Nodejs內(nèi)置npm默認(rèn)配置
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
怎樣使用nodejs更改項(xiàng)目端口號(hào)
怎樣使用nodejs更改項(xiàng)目端口號(hào):這次給大家?guī)碓鯓邮褂胣odejs更改項(xiàng)目端口號(hào),使用nodejs更改項(xiàng)目端口號(hào)的注意事項(xiàng)有哪些,下面就是實(shí)戰(zhàn)案例,一起來看一下。在項(xiàng)目中加入文件:ServerConfvar ServerConf= { ApiHost: "" //后臺(tái)鏈接api ,ServicePort:30