The beautiful thing about Sails is the ability to get alot of the boilerplate code generated quickly for you. This code gives you the basic nuts and bolts you would have to code by hand if you were not using a web framework with node. Sails is based on a MVC pattern heavily influenced by the Ruby on Rails framework, which is why when you define a model you get the basic CRUD functions out of the gate without writing any more code. The thing that Sails does well (never written any rails) is the ability to talk to any database that has an adapter written for you without having to change any of your code inside the app, change where the database is at along with any creds and you're off and running.
Sails has the concept of Policies, these are something that are evaluated prior to running any code inside a controller. Me coming from a .net C# background would litter decorators on my actions inside my controllers to lock down who has access to what methods. It would look a little like this...
Your new post is loading...