Launch the sails on another port, then rise

How can I launch sails and sails at the same time?

From what I read ( https://github.com/balderdashy/sails/tree/master/lib/app ) I need to use sails.load instead of sails.lift . I have no idea where I need to put this and how it connects to the sail console. Any help would be greatly appreciated.

+6
source share
5 answers

sails lift and sails console initially handle some parameters. So you can use:

  • sails lift to run the application on the default port (1337 if you do not change the configuration)
  • sails console --port 1338 in another tab / window for launching the console on another port
+10
source

Try with

 sails lift --port 8080 

It worked for me.

+2
source

open config / env / production.js and scroll down, find // port 80 end and then uncomment it unkoment it

0
source

then find // port: 80 end, uncomment it in config / env / production.js and specify any port you want

after that run the following command

NODE_ENV = production pm2 start app.js - --prod

this will work fine, but if you want -i max than.

NODE_ENV = production start pm2 app.js --name "myapp" -i max - --prod

in the above command, if you solve any problem regarding grunt, than open the task /register/prod.js and comment below the line

 module.exports = function(grunt) { grunt.registerTask('prod', [ // 'polyfill:prod', //Β« Remove this to skip transpilation in production (not recommended) // 'compileAssets', // 'babel', //Β« Remove this to skip transpilation in production (not recommended) // 'concat', // 'uglify', // 'cssmin', // 'sails-linker:prodJs', // 'sails-linker:prodStyles', // 'sails-linker:clientSideTemplates', ]); }; 
0
source

I have a solution without sails.load , since I never use it. Modify your config/bootstrap.js as follows:

 module.exports.bootstrap = function (cb) { if(process.argv[2]){ var port = parseInt(process.argv[2]); sails.config.port = port; } cb(); }; 

then lift the application on node app.js 1234 to run it on port 1234.

But if you still want to use sails.lift , change process.argv[2] to process.argv[3] . Basically, it catches any arguments when the application starts and changes sails.config.port based on your arguments.

-1
source

All Articles