Bootstrap FreeKB - Sails - sails inspect command (start an app)
Sails - sails inspect command (start an app)

Updated:   |  Sails articles

Let's say you have installed a Sails web app named foo-app, meaning you did not use the --no-frontend or --minimal flags when creating the app. The sails lift or sails inspect command can be used to start the web app. The sails lift command can be issued in the directory of the web app (foo-app in this example). Notice that the & character is used to run the process in the background. This is because, by default, the process runs in the foreground, which ties up your command line prompt.

cd /opt/foo-app
sails inspect --port 1337 &

 

By default, events will be logged at log level INFO. The --silly flag can be used to log events at log level silly.

sails inspect --port 1337 --silly &

 

If the app is successfully started, something like this should be returned.

 info: Running app in inspect mode...
 info: ( to exit, type <CTRL>+<C> )

Debugger listening on ws://127.0.0.1:9229/6b5f03fc-de94-407b-a2a6-e058fabd4b4f
For help, see: https://nodejs.org/en/docs/inspector

 info: Starting app...

 info: Initializing project hook... (`api/hooks/custom/`)
 info: Initializing `apianalytics` hook...  (requests to monitored routes will be logged!)
 info: ·• Auto-migrating...  (alter)
 info:    Hold tight, this could take a moment.
 info:  ✓ Auto-migration complete.

debug: Skipping v0 bootstrap script...  (because it's already been run)
debug: (last run on this computer: @ Sat Jul 31 2021 10:53:03 GMT+0000 (Coordinated Universal Time))
 info:
 info:                .-..-.
 info:
 info:    Sails              <|    .-..-.
 info:    v1.4.4              |\
 info:                       /|.\
 info:                      / || \
 info:                    ,'  |'  \
 info:                 .-'.-==|/_--'
 info:                 `--'-------'
 info:    __---___--___---___--___---___--___
 info:  ____---___--___---___--___---___--___-__
 info:
 info: Server lifted in `/foo-app`
 info: To shut down Sails, press <CTRL> + C at any time.
 info: Read more at https://sailsjs.com/support.

debug: -------------------------------------------------------
debug: :: Sun Aug 01 2021 08:38:39 GMT+0000 (Coordinated Universal Time)

debug: Environment : development
debug: Port        : 1337
debug: -------------------------------------------------------

 

Notice in this example that port 1337 is being used. If there is a firewall on your system running Sails, ensure port 1337 is allowed in the firewall. Then navigate to http://<ip address or hostname>:1337 and the following should be displayed.

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 58fd21 in the box below so that we can be sure you are a human.