Trying to connect to a sails.js web-app running on a droplet

March 27, 2018 926 views
Node.js Ubuntu 16.04

I’ve installed everything and successfully lifted the web server. Everything looks fine in the console. But when I try to connect in my browser to <droplet IP>:1337 - I don’t see the page running

info: Starting app…

info: .-..-.
info: Sails <| .-..-.
info: v0.12.14 |\
info: /|.\
info: / || \
info: ,’ |’ \
info: .-’.-==|/–’
info: `–’——-’
info: _

info: ___-_
info: Server lifted in /web/test
info: To see your app, visit http://localhost:1337
info: To shut down Sails, press <CTRL> + C at any time.

debug: ——————————————————-
debug: :: Tue Mar 27 2018 08:00:14 GMT+0000 (UTC)

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

2 Answers

in the production environment, you can alter the port in the production.js file and then lift the server using sails lift --prod. It will start the server on the defined port.

also to make the sails process run continuously you can use the Forever or PM2.

hope this helps!

I figured this out, silly me. Changed the port to 80 and it connected.

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!