Currently is seems that for any code change in a sails.js app you have to manually stop the sails server and run sails lift
again before you can see the changes.
I was wondering if there is any way when running in development mode to automatically restart the sails server when it detects a code change?
Sails is the most popular MVC framework for Node. js, designed to emulate the familiar MVC pattern of frameworks like Ruby on Rails, but with support for the requirements of modern apps: data-driven APIs with a scalable, service-oriented architecture.
Waterline: SQL/noSQL Data Mapper (ORM/ODM) Sails comes installed with a powerful ORM/ODM called Waterline, a datastore-agnostic tool that dramatically simplifies interaction with one or more databases.
Sails is built on Node. js, a popular, lightweight server-side technology that allows developers to write blazing fast, scalable network appliations in JavaScript. Sails uses Express for handling HTTP requests, and wraps socket.io for managing WebSockets.
Upgrading an existing app using the automated tool To get started, we recommend using the Sails 1.0 upgrade tool, which will help with some of the most common migration tasks. To use the tool, first install Sails 1.0 globally with npm install -g sails@^1.0. 0 and then run sails upgrade .
You have to use a watcher like forever, nodemon, or something else...
Install forever by running:
sudo npm install -g forever
Run it:
forever -w start app.js
To avoid infinite restart because Sails writes into .tmp
folder, you can create a .foreverignore
file into your project directory and put this content inside:
**/.tmp/** **/views/** **/assets/**
See the issue on GitHub: Forever restarting because of /.tmp.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With