Here’s the way to create one:

sails generate api users

This will create new controller and model files in your project directory. In Controller folder, this will create UsersController.js and in model folder, this will create UsersModel.js file. Routes would be in controller file.

Now, to test the API, lift your server and run API in POSTMAN.

First start your project using this command:

sails lift

Create User

Now, open POSTMAN and send following JSON data on http://localhost:1337/users URL