How To

TL;DR If you are not interested in reading the post and want to see the results, check out my repository — generator-sails-rest-api.

Otherwise, let’s dive into terminology before reading. I want to be sure you understand terms and what I’m talking about.

What is REST API?

Let’s look at Wikipedia:

In computing, Representational State Transfer (REST) is the software architectural style of the World Wide Web. REST gives a coordinated set of constraints to the design of components in a distributed hypermedia system that can lead to a higher-performing and more maintainable architecture.

Building RESTful web services, like other programming skills is part art, part science. As the Internet industry progresses, creating a REST API becomes more concrete, with emerging best practices. As RESTful Web services don’t follow a prescribed standard except for HTTP, it’s important to build your RESTful API under industry best practices to ease development and simplify client adoption.

As Wikipedia said above, “REST is the software architectural style”. It’s not a library you can install and work with. It’s just a bundle of rules you need to follow when writing your web service.

Read Full Article