简体   繁体   中英

How can I run sails console without a webserver (using any ports)?

I have a Sails server running, and I want to execute some commands from inside of lifted Sails.

The problem is, then I run sails console - it bootstraps another instance of Sails, and trying to load another webserver next to existing, by default using the same ports.

By some environment limits, I can use only one port at the time. So I cannot load another webserver on the same machine.

Is there a way how to run sails console without using any ports?

Thank you.

There is an option. Use sails console --dontLift

Running console without port is I belive not possible at all.

Add inside package json npm script to run console on another port (or if you have sails installed globally just run sails console --port xxxx).

Part of my package json:

"scripts": {
    "start": "node app.js",
    "console": "sails console --port 1338",
    "test": "mocha",
    "docs": "rimraf public/docs && apidoc -i config/routes -o public/docs"
  },

As you can see... npm run console will run sails console on port 1338 while deafult port of my app is 1337...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM