AutoLoading changes with Sails.js

So I started using Sails.js a few days ago and I like it! I get bored easily and I never actually done anything with Node.js besides going through their tutorials. After browsing their documentation line-by-line and as a goal to myself to get better with Javascript, I figured by giving Sails.js a try for my upcoming project I’ll get a better understanding of the language and what the communities has done so far with Javascript.

But one thing that bugs me while playing around with Sails.js is stopping/starting the server every time I made changes to my controller. It’s proven to be annoying by far especially coming from PHP frameworks, Ruby on Rails, Mojolicious, etc… The changes would take place if you’re editing the view files but nothing else.

The solution to all this madness is to use nodemon.

It’s easy. Install using npm like so

npm install nodemon or sudo npm install nodemon

Add a nodemanignore file to your folder called .nodemonignore and add this inside of it

.tmp/*

Then cd or go into your sails project and run this command

nodemon app or sudo nodemon app

That should start you server while nodeman monitors your changes.

And that should be it!

The only thing that annoys me is this error through the console

Hook failed to load: orm (Error: ER_DUP_FIELDNAME: Duplicate column name '_waterline_dummy02492')

I found out on stackoverflow that you can get rid of it by deleting it from your tables. But it keeps coming back. Hopefully they’ll get it fixed. Other than that I’m back to coding without restarting my server.

Downstairz

Leave a Reply

Your email address will not be published. Required fields are marked *