Sails API Generator

0.10.1 · abandoned · verified Tue Apr 21

sails-generate-api is a command-line interface (CLI) generator for the Sails.js framework, designed to scaffold boilerplate files for API models and controllers. Specifically, it creates `api/models/Foo.js` and `api/controllers/FooController.js` for a given API name. This package is from the 0.x era of Sails.js, with its last publication being 9 years ago and current version 0.10.1. The current stable version of Sails.js is 1.5.x, which introduced significant breaking changes from its 0.x predecessors, including a revamped generator architecture. Therefore, `sails-generate-api` is not compatible with modern Sails.js applications (v1.x and above) and should be considered abandoned.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to install, configure, and use the `sails-generate-api` generator to create new API files in a Sails 0.x project.

{
  "generators": {
    "modules": {
      "api": "sails-generate-api"
    }
  }
}

// Save the above JSON to ./.sailsrc in your project directory
// or ~/.sailsrc for global use.

// Then, from your Sails project directory:
// $ npm install sails-generate-api
// $ sails generate api foobar

// This will create:
// - api/models/Foobar.js
// - api/controllers/FoobarController.js

view raw JSON →