问题
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?
回答1:
You have to change the 'host' key. Source
You can change the /config/local.js
file and add the 'host' key to it :
{
port: '1234',
host: '111.111.111.111',
environment: 'production'
}
Source
回答2:
I've tried @xShirase answer and it worked too. So I have it marked as answer. Anyhow, this is what I did on my end:
I added application.js
on config, config/application.js
then added this line module.exports.host = '<ip here>';
来源:https://stackoverflow.com/questions/26208664/bind-sails-js-app-to-a-specific-ip