In the last few posts, we have been building an application using Sails, Angular and RequireJS. We've got a basic UI in place now, so we should be able to get it to a point where we can actually send and receive data from the server.
Now, we have a "completed" boolean for each record that defaults to false and a "description" that is required.
Sails makes creating an API really easy by providing something called "blueprints". The basic idea is that if you have a controller and model with the same name, Sails will automatically create REST and CRUD endpoints that you can easily hit with Ajax.
The really cool thing is that we barely did anything to make all of this possible. It simply works.
If you want to write your own methods for the API, you can add them to your controller and map them with the route config, but 90% of the time, the blueprints will give you everything you need if you have a well-written model layer.
That should be enough to get us to the next post where I will talk about using Angular services to communicate with the Sails api we just created.
If you are following the Github repo, we are currently at this point in the application.