将sails.js应用程序绑定到特定的IP [英] Bind sails.js app to a specific ip
本文介绍了将sails.js应用程序绑定到特定的IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个Nodejs项目,正在使用sails.js mvc框架.现在,我准备部署它,但是在此之前,一个要求是将其绑定到其他ip.在sails.js上有没有一种方法可以实现这一目标?我应该更新什么文件或配置?
I have a Nodejs project and is using sails.js mvc framework. Now, Im ready to deploy it, but before that one requirement is to bind it to a different ip. Is there a way on sails.js that we can achieve this? What file or config should I update?
推荐答案
您必须更改主机"密钥. 来源
You have to change the 'host' key. Source
您可以更改/config/local.js
文件并向其中添加'host'键:
You can change the /config/local.js
file and add the 'host' key to it :
{
port: '1234',
host: '111.111.111.111',
environment: 'production'
}
这篇关于将sails.js应用程序绑定到特定的IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文