Let's create a new Sails.js project and develop our first Sails.js API. To create a new project, use the following command:
sails create <projectName>
To create a new API in Sails.js, you have the following two ways:
I will go for the second method as it's fairly simple and system-generated files are less prone to errors; therefore, you don't have to waste your time debugging these files. However, at the end of this chapter, we will take a look at the first method as well.
To create a new API, just execute the following command from the terminal in the project directory:
sails create api Message
This is it. We created a skeleton of our API ...