Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sailsjs live update during serverside editing

It's annoying to have to restart the sails server when you change something, is there any way to make sailsjs do what meteor does where when you save a serverside file it automatically updates the clientside?

That's a pretty awesome feature, and I love sails but that feature is pretty cool.

like image 815
Carson Wright Avatar asked Oct 04 '13 05:10

Carson Wright


People also ask

How can i Improve my sailsjs experience?

For a better experience on sailsjs.com, update your browser. sails.config.* The Sails framework is built by a web & mobile shop in Austin, TX, with the help of our contributors. We created Sails in 2012 to assist us on Node.js projects.

How do I update a user's name in sails?

To update a particular record, use .updateOne (). await User.update ( { name: 'Pen' }) .set ( { name: 'Finn' }); sails.log ( 'Updated all users named Pen so that their new name is "Finn". I hope they like it.' );

What is sails framework?

The Sails framework is built by a web & mobile shop in Austin, TX, with the help of our contributors. We created Sails in 2012 to assist us on Node.js projects. Naturally we open-sourced it. We hope it makes your life a little bit easier!


1 Answers

Nodemon is a helpful development tool that watches the files in the directory that it was started in, and if anything changes are detected, your node.js application will automatically restart.

To install nodemon (you may need to use sudo)

$ npm install -g nodemon

Sails.js continually writes to the .tmp folder, and as a result you will find that nodemon will continually restart the server. To resolve this issue, simply ignore this folder by creating a .nodemonignore file with this single line, noting you can place any other files/folders you wish to ignore on separate lines

.tmp/*

To run your Sails.js application through nodemon

$ nodemon app

For more information, be sure to check out nodemon on npmjs.org

like image 158
scott Avatar answered Oct 24 '22 15:10

scott